This section demonstrates the use of array_push function in php
This section demonstrates the use of array_push function in php
<?php
$arr1=array(1,2,3,4,5);
foreach ($arr1 as $ar) {
echo " ".$ar;
}
echo "<br>after
pushing elements <br>";
array_push($arr1,12,19);
foreach ($arr1 as $ar1){
echo " ".$ar1;
}
?>
Output
1 2 3 4 5
after pushing elements
1 2 3 4 5 12 19