I am able to create array values using
$array = array("key" => "value" ... );
Now I want to add them dynamically after assigning the value to $array
you can access your array by using []
so
$array["new_key"] = "new value";
<?php
$array = array(
"foo" => "bar",
42 => 24,
"multi" => array(
"dimensional" => array(
"array" => "foo"
)
)
);
var_dump($array["foo"]);
var_dump($array[42]);
var_dump($array["multi"]["dimensional"]["array"]);
?>
This helps you. Refer the php documentation of arrays.