This question already has answers here:
Answer
Solution:
by using end();
<?php
?�?�$arr = array('Ram', 'Shita', 'Geeta');
?�?�echo end($arr);
?>
Answer
Solution:
all you have to do is
echo $users[count($users) - 1];
Answer
Solution:
Use end() -function.
PHP Manual - End function
Source