已知:原页面为 http://gold.ncfdc.com.cn/default.aspx?tname=205\gc
子页规格是 http://gold.ncfdc.com.cn/default.aspx?tname=205\gc_text&hrefId=(*)
要求: 现在得到原页面中所有含的子页中 http://gold.ncfdc.com.cn/default.aspx?tname=205\gc_text&hrefId=(*) 这种页面(不考虑原页面中的分页,只需用原页面中的当前页)
按要求应该得到:
http://gold.ncfdc.com.cn/default.aspx?tname=205\gc_text&hrefId=2577
http://gold.ncfdc.com.cn/default.aspx?tname=205\gc_text&hrefId=2579
.... 这应该如何实现呀,thanks
子页规格是 http://gold.ncfdc.com.cn/default.aspx?tname=205\gc_text&hrefId=(*)
要求: 现在得到原页面中所有含的子页中 http://gold.ncfdc.com.cn/default.aspx?tname=205\gc_text&hrefId=(*) 这种页面(不考虑原页面中的分页,只需用原页面中的当前页)
按要求应该得到:
http://gold.ncfdc.com.cn/default.aspx?tname=205\gc_text&hrefId=2577
http://gold.ncfdc.com.cn/default.aspx?tname=205\gc_text&hrefId=2579
.... 这应该如何实现呀,thanks
preg_match_all('/\/default\.aspx\?tname=205\\\\gc_text&hrefId=\d+/is', $string, $matches);
print_r($matches);
?>
再延伸下:php页面中
已知三个参数: 主页url,主页中所含的所有子页url,url规格
要求:从所有的子页中按url规格去输出相应的url