Given an array of values, process them so that their order in the array is reversed.
The PHP array_reverse function makes this a very simple problem.
<? // some values to be processed $values = array(9, 4, 3, 0, 1, 5); // show them in the normal order and reversed order echo 'Normal: ' . implode(', ', $values) . '<br/>' . 'Reversed: ' . implode(', ', array_reverse($values));?>Which produces:
Normal: 9, 4, 3, 0, 1, 5
Reversed: 5, 1, 0, 3, 4, 9