Answers for "php how to push info to an associative array"

PHP
6

add item to array in php

<?php

$a=array("red","green");

array_push($a,"blue","yellow");

print_r($a);
?>
Posted by: Guest on May-25-2020
0

php add new item to associative array

$a = array('foo' => 'bar'); // when you create
$a['Title'] = 'blah'; // later
Posted by: Guest on April-07-2020

Code answers related to "php how to push info to an associative array"

Browse Popular Code Answers by Language