Find the last array from multidimensional array in PHP
Today I am going of discuss the following topic:-
Find the last array from multidimensional array in PHP:-
Take multidimensional Array in PHP:-
Output of this array is show in below screenshot:-
Find the last array from multidimensional array in PHP:-
Take multidimensional Array in PHP:-
$arr[] = array(
"name" => "John 1",
"email" => "john1@gmail.com",
);
$arr[] = array(
"name" => "John 2",
"email" => "john2@gmail.com",
);
$arr[] = array(
"name" => "John 3",
"email" => "john3@gmail.com",
);
$arr[] = array(
"name" => "John 4",
"email" => "john4@gmail.com",
);
$arr[] = array(
"name" => "John 5",
"email" => "john5@gmail.com",
);
$arr[] = array(
"name" => "John 6",
"email" => "john6@gmail.com",
);
echo "<pre>";
print_r($arr);
echo "</pre>";
Output of this array is show in below screenshot:-
Then write following command:-
echo "<pre>";
print_r(end($arr));
echo "</pre>";
and it's output will be:-
If you have any doubt in PHP, please let me know, I'll try my best solve your problem.
Please share your valuable feedback.
Thanks.

Gudddd..
ReplyDeleteIt's Superb for learning 👍👍
Thanks Dear
Delete