我有两个 foreach 循环:第一个:
foreach ($items as $key => $item)
{
$keywords = explode(' ', $qsvarus);
$title[$key] = preg_replace('/\b('.implode('|', $keywords).')\b(?![^<]*[>])/i', '<b>$0</b>', $title[$key]);
$infoo[$key] = preg_replace('/\b('.implode('|', $keywords).')\b(?![^<]*[>])/i', '<b>$0</b>', $infoo[$key]);
echo '<tr><td>'.$title[$key].$infoo[$key].$item.'</tr></td>';
}
第二个:
foreach ($linkai as $key => $linkas) {
$i++;
$a1 = $linkas[1];
$a2 = str_replace("download/", "files/", $a1);
$a3 = str_replace("&","&", $a2);
$a4 = str_replace("amp;nbsp;","nbsp;", $a3);
echo "<div class=\"bgframe".str_replace("/i/", "/IMG/", $a4)."</div></div>";
}
问题是如何使这两个循环显示如下结果:
Result1 from Loop1
Result1 from Loop2
Result2 from Loop1
Result2 from Loop2
Result3 from Loop1
Result3 from Loop2
And so on...
代替:
Result1 from Loop1
Result2 from Loop1
Result3 from Loop1
...
Result1 from Loop2
Result2 from Loop2
Result3 from Loop2
谢谢