php last item of array
snippet in php

php last item of array

user3562

echo end(['Gon', 'Killua', 'Hisoka']) // print Hisoka

php get last array element

user5816

<?php 
  
// input array 
$arr = array('Ram', 'Shita', 'Geeta'); 
  
// end function print the last 
// element of the array. 
echo end($arr);  
  
?>