array_push: Push one or more elements onto the end of array : Stack « Data Structure « PHP






array_push: Push one or more elements onto the end of array

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

           
       








Related examples in the same category

1.array_pop: Pop the element off the end of array
2.A stack with type restricted to int
3.Stack in Use