I need to create the following array:
$data = array(
"invoice_info" => array(
...
),
"product_info => array(
array(
"name" => "product 1",
...
),
array(
"name => "product 2",
...
)
)
);
I am currently struggling to get the products into my "product_info" array. For each product I want to add I use the following line:
$product_info[] = array("name" => "product 1", ...);
This works fine for the first one. Adding another one, however, overwrites it. The second problem is, that keys are added, that should not be there:
[product_info] => Array
(
[0] => Array
(
[name] => product 2
[qty] => 293
[price] => 44
[sum] => 12892
)
)
This is the output after adding 2 products. Just the second one is included. What am I doing wrong?
$product_infocome from? It's$data['product_info'].