【发布时间】:2016-04-21 16:36:07
【问题描述】:
所以对于我的代码,我基本上需要从网页获取特定的 URL,我使用 Simple HTML DOM Parser,到目前为止,我设法从网页中获取所有链接,类为 .linkify,结果有 18 个不同的链接,我只需要在变量中包含第二个链接。
这是我的代码:
$html = file_get_html("http://saucenao.com/search.php?db=999&url=http://simg4.gelbooru.com//images/4f/3d/$file");
foreach($html->find('a.linkify') as $element)
echo $element->href . '<br>';
我如何使它只生成第二个链接?
谢谢!
【问题讨论】: