【发布时间】:2012-07-30 16:57:03
【问题描述】:
html链接是:
<a title="Next page of results" class="sprBtnSRP1 enabled" href="http://www.link.com/page.html?thisisthelink&_pgn=2&_al=25&at=tc"><i>Next</i><b class="sprBtnSRP1"></b></a>
php 是:
function NextLink($url){
$html= WGET($url);
$urlpattern1 = '/Next"><a[^>]+pgn=([^"]+)/i';
preg_match_all($urlpattern1, $html, $matches1);
$nextlink='http://www.link.com/page.html?thisisthelink&_pgn=';
foreach ($matches1[1] as $u) {
$nextlink = $nextlink.$u;
}
return $nextlink;
}
================
不再工作了,我需要在 PHP 中将 $nexlink.$u 变成 http://www.link.com/page.html?thisisthelink&_pgn=2&_al=25&at=tc
问题是 $urlpattern1
提前感谢您的帮助!
【问题讨论】:
标签: php hyperlink href extract