|
Hello
I have two arrays with data that relates directly to each other.
Key 0 in the first array relates to key 0 in the second and so on.
Array1 ( [0] => 4 [1] => 9 [2] => 12 [3] => 16 [4] => 18 [5] => 20 )
Array2 ( [0] => 1 [1] => 3 [2] => 1 [3] => 1 [4] => 1 [5] => 2 )
I need a way to loop through these arrays in order to add/subtract amounts stored in a database. Array1 is the product id and Array 2 is the amount.
What is the best way of doing this?
Thanks in advance.
|