push key value in associative array php code example
Example 1: php add to associative array
// for php 5.4+
$data += [$key => $value];
// for php 5.4-
$data += array($key => $value);
Example 2: php add to existing associative array
$a1=['aa'=>'123' , 'bb'=>'454'];
$a1 = array_merge( $a1 , ['a'=>1,'b'=>2] ) ;