$_post[' A '] value is 1,2,3,4,5
$_post[' B '] value is a,b,c,d,e
$_post[' C '] value is 6,7,8,9,0
$_post[' d '] value is h,i,j,k,l
$_post[' E '] value is o,p,q,r,s
These five arrays are also In the back. Now I'm going to write them all into the database, how should the loops be written? foreach appears to be only for an array.
The last write to the database format should be
First: 1 a 6 h i
Article II: 2 b 7 I P
Article three: 3 C 8 J Q
Fourth: 4 D 9 k R
Fifth: 5 e 0 L s
Reply to discussion (solution)
foreach ($_post[' a '] as $i = = $a) { $b = $_post[' B ']; $d = $_post[' C '); $d = $_post[' d ']; $e = $_post[' E ']; With $a, $b, $c, $d, $e related actions}
can also
foreach (Array_map (null, $_post[' a '], $_post[' B '), $_post[' C '], $_post[' d '], $_post[' e ']) as $r) { //$r Related actions}
foreach ($_post[' a '] as $i = = $a) { $b = $_post[' B ']; $d = $_post[' C '); $d = $_post[' d ']; $e = $_post[' E ']; With $a, $b, $c, $d, $e related actions}
can also
foreach (Array_map (null, $_post[' a '], $_post[' B '), $_post[' C '], $_post[' d '], $_post[' e ']) as $r) { //$r Related actions}
I have each column in the database corresponding to a column, this looks like a bad one to write
See what you got in the loop yourself.