php add value to array with key code example
Example 1: array_push php
<?php
$cesta = array("laranja", "morango");
array_push($cesta, "melancia", "batata");
print_r($cesta);
?>
Example 2: add item to array in php
<?php
$a=array("red","green");
array_push($a,"blue","yellow");
print_r($a);
?>
Example 3: php add new item to associative array
$a = array('foo' => 'bar'); // when you create
$a['Title'] = 'blah'; // later