php add an element to an associative array code example
Example 1: php append element to array
array_push($cart, 13);
Example 2: add item to array in php
<?php
$a=array("red","green");
array_push($a,"blue","yellow");
print_r($a);
?>
array_push($cart, 13);
<?php
$a=array("red","green");
array_push($a,"blue","yellow");
print_r($a);
?>