end() function in php
PHP end() function is used to move the current pointer of the array to the end and return the value on that position. It is an inbuilt function of PHP.
$array is a PHP array.
<?php $arr1 = array("apple","orange","banana","fig",); $last_value=end($arr1); // it will return the last item of array i.e. fig echo "last item of array is $last_value <br>"; ?>
Note: You should also read prev(), next(), current() and reset() functions.
Waiting for your comments