Hi all,
I am aiming to create an array with the same structure as this:
Array
(
[798D25C0DEABD] => Array
(
[quantity] => 1
)
[40B2B0FA3D222] => Array
(
[quantity] => 1
)
)
The code I am using is therefore:
for($i = 0; $i < count($response); $i++)
{
$ph[] = array($response[$i] => array('quantity' => $iteminfo[$i][1]));
}
However, this outputs an array that looks like this:
Array
(
[0] => Array
(
[EB9A045DF3F11] => Array
(
[quantity] => 1
)
)
[1] => Array
(
[79EA2FC5287C0] => Array
(
[quantity] => 1
)
)
)
How do I get rid of the incremental sub-arrays and keep everything under the one? Using $ph =
on its own obviously doesn't work since it only stores the last array in the for statement. Can someone help?