I have the following code, but it runs the foreach loop one at a time. Is there a way of making them all run at once?
foreach($json['orders']['cnr_output_ship_to_header'] as $header)
{
$orders_array[] = $header;
$guests_array[] = $header['guests']['cnr_output_guest_detail'];
$items_array[] = $header['items']['cnr_output_item_detail'];
}
foreach($guests_array as $guests)
{
pdo_insert('cnr_output_guest_detail', (array)$guests);
}
foreach($items_array as $items)
{
pdo_insert('cnr_output_item_detail', (array)$items);
}
foreach($orders_array as $orders)
{
pdo_insert('cnr_output_ship_to_header', (array)$orders);
}
why not this: