Function to add an element into an array – PHP

<?php
 $testArray = array("value1", "value2");
 array_push($testArray, "value3", "value4");
 print_r($testArray);
 //rray ( [0] => value1 [1] => value2 [2] => value3 [3] => value4 )
?>
Share

Leave a Reply

Your email address will not be published. Required fields are marked *