PHP Function to add an element into an array – PHP May 11, 2011 Pramod T P Leave a comment <?php $testArray = array("value1", "value2"); array_push($testArray, "value3", "value4"); print_r($testArray); //rray ( [0] => value1 [1] => value2 [2] => value3 [3] => value4 ) ?>