PHP Programing language

array_push() Function in PHP
Previous Home Next

array_push()

The array_push() function inserts one or more elements to the end of an array.

Syntax:
array_push(array,value1,value2...)

In above syntax, "array" specifies an array, "value1" specifies the value to add and "value2" specifies the value to add

Example:

<?php
$a=array("Apple","Banana");
array_push($a,"Mango","Orange");
print_r($a);
?>

Output:

Array ( [0] => Apple [1] => Banana [2] => Mango [3] => Orange )

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: