PHP头条
热点:

phpfile_get_contents转curl抓取淘宝属性


phpcurl

以下代码如何改为用 curl来抓取呢?并且以商品的IID保存
function get_shuxing($type,$iid){
if($type=='tmall'){
$text=file_get_contents("http://detail.tmall.com/item.htm?id=$iid");
preg_match('|

    (.*)
|isU',$text, $match);
}elseif ($type=='taobao'){
$text=file_get_contents("http://item.taobao.com/item.htm?id=$iid");
preg_match('|
    (.*)
|isU',$text, $match);
}
$match=$match[0];
$match = iconv('gbk', 'utf-8', $match);
echo $match;
}

www.phpzy.comtrue/phpyy/2336.htmlTechArticlephpfile_get_contents转curl抓取淘宝属性 phpcurl 以下代码如何改为用 curl来抓取呢?并且以商品的IID保存 function get_shuxing($type,$iid){ if($type=='tmall'){ $text=file_get_contents("http://detail.tmall.com/item.htm...

相关文章

相关频道:

PHP之友评论

今天推荐