How to use php array_push() function <?php $a=array("a"=>"red","b"=>"green"); array_push($a,"blue","yellow"); print_r($a); ?> The array_push() function inserts one or more elements to the end of an array. Syntax array_push(array, value1, value2, …)