I am in a unique fix. It is easy but for the love of god I havent able to figure it out.
Code
// Loop through results
for($k=0;$k<count($orderNumber);$k++) {
// Add a new array for each iteration
$div[] = array (
$orderNumber[$k]=>array(
"customerOrderId"=>$orderNumber[$k],
"status"=>$orderStatus[$k],
"readyTime"=>$orderShipDate[$k]
));
}
Returns
[
{}
{}
{}
]
I although need the API to return in the following format.
"orders" : {
{}
{}
{}
}
Can someone guide me in the correct direction?
orders, like$div['orders'] = array (...). And you can't have an object of objects like you want, you will have"orders": [ {}, {}, {} ]as final result.