【发布时间】:2016-05-16 07:08:02
【问题描述】:
我有这样的结构:
<div class="test">
<span>one</span>
</div>
<div class="test">
<span>two</span>
</div>
<div class="test">
<span>three</span>
</div>
这是我的代码:
foreach($html->find('div[class=test]') as $article) {
echo $type .= $article->find('span',0)->plaintext."<br>";
}
这是当前结果:
one
two
three
这是预期的结果:
two
我该怎么做?
注意:我使用this PHP 库。
【问题讨论】: