欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php 信息采集程序代碼

 更新時間:2009年03月17日 23:19:14   作者:  
通過檢測,$c已經(jīng)是內(nèi)容頁的數(shù)據(jù)流了,可是$pc這個的正則表達(dá)式為什么只匹配<這個字符其他的都沒有呢
復(fù)制代碼 代碼如下:

<?
//采集首頁地址
$url="http://emotion.pclady.com.cn/skills/";
//獲取頁面代碼
$rs=file_get_contents($url);
//設(shè)置匹配正則
//$fp=fopen("text.txt","a");
//$fw=fwrite($fp,$rs);
//fclose($fp);
/*<I class=titles><A

target=_blank>留住你身邊的好男人</A></I>*/
$preg='/<i\s+class=\"titles\"><a\s+href=\"[^>]+\">(.*)<\/a><\/i>/i';
//進(jìn)行正則搜索
preg_match_all($preg,$rs,$title);
//計(jì)算標(biāo)題數(shù)量
$count=count($title[0]);
echo $count."<br>";
//通過標(biāo)題數(shù)量進(jìn)行內(nèi)容采集
for ($i=0;$i<$count;$i++){

//設(shè)置內(nèi)容頁地址
$pr='/<a\s+href=\"[^>]+\">/isU';
preg_match_all($pr,$title[0][$i],$jurl);
$substr=substr($jurl[0][0],9);
$curl=substr($substr,0,-18);
//獲取內(nèi)容頁代碼
$c=file_get_contents($curl);
//設(shè)置內(nèi)容頁匹配正則
$pc='/<a\s+href=\"[^>]+\">/i';
//進(jìn)行正則匹配搜索
preg_match($pc,$c,$content);
//輸出標(biāo)題
echo $title[0][$i]."<br>";
echo $title[1][$i]."<br>";
$concount=count($content[0]);
echo $concount."<br>";
echo $content[0][0];
for ($j=0;$j<$concount;$j++){

}
}
?>

通過檢測,$c已經(jīng)是內(nèi)容頁的數(shù)據(jù)流了,可是$pc這個的正則表達(dá)式為什么只匹配<這個字符其他的都沒有呢,是因?yàn)槲疑厦嬗昧藄ubsrt()函數(shù)嗎?還是什么問題?麻煩各位大俠指點(diǎn)迷津???

相關(guān)文章

最新評論