assume you have the same number of items in those two arrays.
if you want to use foreach()
, then the arrays need to have the same index:
foreach ($a as $index => $value)
{
echo $a[$index] .' '. $b[$index];
}
if the arrays have numeric index, you can just use for()
:
for ($i = 0; $i < sizeof($a); $i++)
{
echo $a[$i] .' '. $b[$i];
}