I passed 2 arrays through $_POST and am trying to use the data in a php function. I am able to loop through each of the arrays using a foreach loop.
However, I need to loop through one of these arrays while accessing the other one in tandem (ie, on the first element in array1, I need to access the first element of array2)--so a nested foreach loop obviously doesn't help.
I have found that I cannot access the values by numerical index, however--except the first value of the array.
Any help would be greatly appreciated.
Here is the current snippet:
$count = 1;
foreach ($quantityArray as $quantity):
if($quantity < 1){
...
$order_to_item_idArray[$count]…..
}
if($quantity > 0){
...
$order_to_item_idArray[$count]…...
}
...
$count = $count + 1;
endforeach;