I have an array:
$test = Array
(
["foo"] => Array
(
["totalsales"] => 80
["totalamount"] => 4
)
(
I want to add new indices with values:
$test["foo"][$date] = 20; // $date = 2013-06-30
$test["foo"][$date] = 40; // $date = 2013-06-25
The output looks like this:
$test = Array
(
["foo"] => Array
(
["totalsales"] => 80
["totalamount"] => 4
["2013-06-25"] => 40
)
(
I would expect the array to look like this:
$test = Array
(
["foo"] => Array
(
["totalsales"] => 80
["totalamount"] => 4
["2013-06-30"] => 20
["2013-06-25"] => 40
)
(
How can this be done? Thanks and sry for my bad english.