Get php array last value and key

by Jayanthi 2012-06-11 15:48:00

php array last value and last Index

<?php
$array=array(1,12,23,45,56,89,100);
$lastValue=end($array);
echo $lastValue."--";
end($array);
$lastKey = key($array);
echo $lastKey;
?>
1130
like
0
dislike
0
mail
flag

You must LOGIN to add comments