submit
in the form, I get the following arrays (In case I had 3 products in form, if I only have 1, in the 4 arrays I would only have index 0 if I had 5 products in the 4 arrays would have 0, 1, 2, 3 and 4 indexes)
'tempero' =>
array (size=3)
0 => string 'Ketchup' (length=7)
1 => string 'Mustard' (length=7)
2 => string 'Barbecue' (length=8)
'quantidade' =>
array (size=3)
0 => string '1' (length=1)
1 => string '2' (length=1)
2 => string '3' (length=1)
'frequencia' =>
array (size=3)
0 => string 'FKetchup' (length=2)
1 => string 'FMustard' (length=2)
2 => string 'FBarbecue' (length=2)
'combo' =>
array (size=3)
0 => string 'CKetchup' (length=2)
1 => string 'CMustard' (length=2)
2 => string 'CBarbecue' (length=2)
My problem is next, I would need to put the corresponding items in arrays, in case I would need something like this:
'tempero1' =>
array (size=3)
0 => string 'Ketchup' (length=7)
1 => string '1' (length=7)
2 => string 'FKetchup' (length=8)
3 => string 'CKetchup' (length=8)
'tempero2' =>
array (size=3)
0 => string 'Mustard' (length=7)
1 => string '2' (length=7)
2 => string 'FMustard' (length=8)
3 => string 'CMustard' (length=8)
'tempero3' =>
array (size=3)
0 => string 'Barbecue' (length=7)
1 => string '3' (length=7)
2 => string 'FBarbecue' (length=8)
3 => string 'CBarbecue' (length=8)
How could I do to merge the corresponding items into a single array, perhaps using a foreach?