2

我使用 file_get_contents 抓取了一些网址和标题。现在我想编辑它们并显示在我的页面中。但我不认为这是可能的。

$html = file_get_html($gg_url);
// find all div tags with id=s
$ttt = $html->find('div.s');

结果是:

www.example.com and bla bla bla under that DIV

但是那个网址是这样标记的<cite>www.exaple.com</cite>

我所需要的只是结果中的 url,但整个内容(url + 其他文本)都在一个变量中。有没有办法得到那个网址?

4

1 回答 1

3
$html = file_get_html($gg_url);
$ttt = $html->find('cite')->innertext;
echo $ttt;
于 2012-05-05T11:25:15.550 回答