array_pop: Pop the element off the end of array : Stack « Data Structure « PHP






array_pop: Pop the element off the end of array

<?php
   $states = array("Ohio","New York","California","Texas");
   $state = array_pop($states); // $state = "Texas"
   print_r($states);
?>

           
       








Related examples in the same category

1.array_push: Push one or more elements onto the end of array
2.A stack with type restricted to int
3.Stack in Use