push multiple items to array php code example
Example 1: add item to array in php
<?php
$a=array("red","green");
array_push($a,"blue","yellow");
print_r($a);
?>
Example 2: php array push one key multiple values
$temp['value']=array('key1'=>'value1','key2'=>'value2');
Example 3: php add new item to associative array
$a = array('foo' => 'bar'); // when you create
$a['Title'] = 'blah'; // later