Returns the previous element.
The prev() function moves the internal pointer of an array to the previous element and returns that element.
<?php
$array1 = array("one", "two", "three");
end($array1);
while ($element = current($array1)) {
print "$element ";
prev($array1);
}
?>
three two one
This example shows how the prev() function can be used to go through an array starting at the end.