how to get last array element in php
<?php
$source_array = ['key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'];
$result = end($source_array);
echo "Last element: ".$result;
?>
how to get last array element in php
<?php
$source_array = ['key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'];
$result = end($source_array);
echo "Last element: ".$result;
?>
php index of last element in array
<?php
$source_array = [
'key1' => 'value1',
'key2' => 'value2',
'key3' => 'value3'
];
echo "Last index: " . array_key_last($source_array);
?>
php last item of array
echo end(['Gon', 'Killua', 'Hisoka']) // print Hisoka
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us