How to form the ¥test format for all result sets that the For loop comes out of.
For example, I have 100 records in a recordset $row.
for ($k =0; $k <$100; $k + +) {
$arr =array ($a [$k], $b [$k], $c [$k]);
Print_r ($arr);
}
I can now put these 100 loops out, is 100 a only array, I now want to turn this into a two-dimensional array, write hair.
As the result of the above output is
Array ([0] = a1 [1] = B1 [2] = C1)
Array ([0] = ASDF2 [1] = B2DF [2] = B2SD)
Array ([0] = a3 [1] = B3 [2] = B6)
Array ([0] = a4 [1] = b4 [2] = SDFs)
I want the result of this. ,
is $test=array ([0] = a1 [1] = B1 [2] = = C1), array ([0] = ASDF2 [1] = = B2DF [2] = = B2SD), Array ( [0] = = a3 [1] = B3 [2] = B6), Array ([0] = a4 [1] = = B4 [2] = = SDFs)
Share to:
------Solution--------------------
for ($k =0; $k <100; $k + +) {
$arr []=array ("A$k", "B$k", "c$k");
}
Print_r ($arr);