The end() function moves the internal pointer to, and outputs, the last element in the array.
Example:
<?php $people = array("vrije", "rahul", "amit", "jai"); echo current($people) ; echo end($people); ?>
Output:
vrije jai
End function can set the pointer of an array to the last element of array.
e.g : <?php $arr = array('name'=>'angel','age'=>'23','city'=>'delhi','profession'=>'php developer'); $lastValue = end($arr); ?>
OUTPUT : php developer .