array_pop( ) returns the value from the end of the array while also removing it from the array. : array_pop « Data Structure « PHP






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

1.array to comma string
2.Remove array elements