array_pop( ) returns the value from the end of the array while also removing it from the array.
//mixed array_pop ( array &arr )
<?
$names = array("Timmy", "Bobby", "Sam", "Tammy", "Joe");
$firstname = array_pop($names);
?>
Related examples in the same category