Php array_push() Function

The array push function is used to inserts one or many elements to end of the array. Mainly this function required two arguments that name are array stack,mixed var.

Demo :



Array List :
 
 
Array Push :
 
 

Example :

Just you type a number or character to in the above array list like this Cherry , Strawberry . Now will be to store the value for the array. Then click add button the output will be display like this Array ( [0] => Cherry [1] => Strawberry) at the below of the array list value. if you need to insert elements at the array list you enter the data at the array push text box and click push button.Then will be stored the data in the above array then output will displayed.

if you need to array_push() function example following code useful to you.


<?php
  $arrays = array("one", "two", "three", "four", "five");
  array_push($arrays,'six',seven');
  print_r($arrays);
?>

In the above entire array list has been stored in $arrays variable.array_push() function is used to insert of array value in the array list.

Free Download Script :

If you need to array_push() function code download from following link.

Download




Content