I am writing a PHP exercise script for the elevator and the people there, it's not important, because everything is ready, though - there was a problem at the end of the task. I want to display the last record of an array, more specifically the weight.
Sorry, I'm getting a null argument error, although print_r of the last array record returns the correct data. What am I doing wrong?
$elevatorContent = array (
array (
"firstname" => "Peter",
"weight" => 70
),
array (
"firstname" => "Cassie",
"weight" => 70
),
array (
"firstname" => "John",
"weight" => 150
),
array (
"firstname" => "Agnes",
"weight" => 150
),
);
This returns null
echo "<p>The last person in elevator is <b>".end($elevatorContent['firstname']). "<b></p>";