Reversing an Array Using array_reverse()
<?php $dogs = array('A' => 'C', 'B' => 'D', 'X' => 'Z', 'Q' => 'T'); array_reverse($dogs); printf("<pre>%s</pre>\n", var_export($dogs, TRUE)); $nums = array(5, 2.2, -4, 2.3, 10); array_reverse($nums); printf("<pre>%s</pre>\n", var_export($nums, TRUE)); ?>