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