In this tutorial learn how to get the last value from an array in php.
function last($array) { return array_pop($array); }
TUTORIAL
<?php $array = Array ( 'user_id' => 10, 'id' => 2, 'user' => 'Nakiya', ); /** * Get the last value from an array. */ function last($array) { return array_pop($array); } var_dump(last($array));
OUTPUT : DEMO
string(6) "Nakiya"
No comments:
Post a Comment