<?php
$source_array = [
'key1' => 'value1',
'key2' => 'value2',
'key3' => 'value3'
];
echo "Last index: " . array_key_last($source_array);
?>
end($arr)
$array = ['key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'];
$result = end($array);
end(array[]);
array_slice($a, -3, 3, true);
<?php
$source_array = [
'key1' => 'value1',
'key2' => 'value2',
'key3' => 'value3'
];
echo "Last index: " . array_key_last($source_array);
?>
end($arr)
$array = ['key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'];
$result = end($array);
end(array[]);
array_slice($a, -3, 3, true);