array_push() function insert one or more elements at the end of the array.
Following is the example of array_push() function
<?php
$a=array("Dog","Cat");
array_push($a,"Horse","Bird");
print_r($a);
?>
The out put will be
Array ( [0] => Dog [1] => Cat [2] => Horse [3] => Bird )
Following is the example of array_push() function
<?php
$a=array("Dog","Cat");
array_push($a,"Horse","Bird");
print_r($a);
?>
The out put will be
Array ( [0] => Dog [1] => Cat [2] => Horse [3] => Bird )
No comments:
Post a Comment