how to add a key and value to an array in php code example
Example 1: array_push
$array[$key] = $value;
// or
$array[] = $value;
// or
array_push($array, [ mixed $... ]);
Example 2: php add item to array
<?php
$z = ['me','you', 'he'];
array_push($z, 'she', 'it');
print_r($z);
?>