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