Accessing PHP array passed through $_POST -


I passed 2 arrays through $ _POST and am trying to use the data in a php function. I am able to loop through each array using a foreach loop

However, I need a loop through one of these arrays, while the other To enter tandem (i.e., on the first element in array1, I need to reach the first element of array2) - then nested foreach loop obviously does not help.

I have found that I can not use 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; Foreign currency ($ quantity $ in the form of quantity): If ($ quantity & lt; 1) {... $ order_to_item_idArray [$ count] ... ..} ($ quantity> 0) {.. $ Order_to_item_idArray [$ count] ... ...} ... $ count = $ count + 1; Endforeach;  

You want to achieve something that you want:

$ a as $ key => $ c

here (as the pseudo-code):

  $ a = array ( 'DSA', 'Das', 'asf'); $ B = array ('aaa', 'eee', 'ggg'); Forex Currency ($ one $ key = & gt; $ c) {echo $ c "-" $ b [$ key]; }   

For your code, this line will be:

  foreach ($ quantity = $ key = $ gt; $ as quantity)  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -