$html = file_get_html(''.$result[]=$row.'?p='.$i.'');
foreach($html->find('span img') as $a)
echo $a->outertext . '<br>';
foreach($html->find('a.product--title') as $b)
echo $b->innertext . '<br>';
foreach($html->find('span.price--default') as $c)
echo $c->innertext . '<br>';
我正在写一个解析器。我需要以这种格式显示内容。
$a1
$b1
$c1
$a2
$b2
$c2
现在正在渲染内容。
$a1
$a2
$a3
$b1
$b2
$b3
这就是为什么我认为是否有可能以某种方式将所有 foreach 合并为一个?
就像是: