Source Code:
(back to article)
<?php $array = [1, 2, 3, 4, 5]; $num_elements = count($array); $last_key = $array[$num_elements - 1]; // OR $array = [1, 2, 3, 4, 5]; $last_key = end($array); reset($array); print_r($array);
Result:
Report an issue