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






Push one or more elements onto the beginning of array

 
<?
$queue = array("p1", "p3");
array_unshift($queue, "p4", "p5", "p6");
?>
  
  








Related examples in the same category

1.Adding an Element to the End of an Array
2.Adding array elements
3.array_push( ) pushes value onto the end of the array
4.array_push() function appends one or more values onto the end of the array.
5.Push one or more elements onto the end of array