1.header('Content-Type:text/html;charset=gbk');
$sourl = "http://s.taobao.com/search?tab=all&sort=sale-desc&style=grid&sortn=3&sort2=_price&fs=0&initiative_id=listz_20130624&q=金龙鱼&filterFineness=2&atype=b";
$so_content = file_get_contents($sourl);
//$so_content = iconv('GB2312', 'UTF-8', $so_content);
var_dump($so_content);
2.$sourl = "http://s.taobao.com/search?tab=all&sort=sale-desc&style=grid&sortn=3&sort2=_price&fs=0&initiative_id=listz_20130624&q=金龙鱼&filterFineness=2&atype=b";
$so_content = file_get_contents($sourl);
$so_content = mb_convert_encoding($so_content,'utf-8','gbk');
//$so_content = iconv('GB2312', 'UTF-8', $so_content);
preg_match_all('/<a trace="auction" traceNum="2"\s*href=\"(.*?)\s*target=\"_blank\"\s*title=\"24k金头过背,过背金龙,蓝底过背,龙鱼,观赏鱼,金头盔\">/i', $so_content,$match);
var_dump($match[1][0]);
$sourl = "http://s.taobao.com/search?tab=all&sort=sale-desc&style=grid&sortn=3&sort2=_price&fs=0&initiative_id=listz_20130624&q=金龙鱼&filterFineness=2&atype=b";
$so_content = file_get_contents($sourl);
//$so_content = iconv('GB2312', 'UTF-8', $so_content);
var_dump($so_content);
2.$sourl = "http://s.taobao.com/search?tab=all&sort=sale-desc&style=grid&sortn=3&sort2=_price&fs=0&initiative_id=listz_20130624&q=金龙鱼&filterFineness=2&atype=b";
$so_content = file_get_contents($sourl);
$so_content = mb_convert_encoding($so_content,'utf-8','gbk');
//$so_content = iconv('GB2312', 'UTF-8', $so_content);
preg_match_all('/<a trace="auction" traceNum="2"\s*href=\"(.*?)\s*target=\"_blank\"\s*title=\"24k金头过背,过背金龙,蓝底过背,龙鱼,观赏鱼,金头盔\">/i', $so_content,$match);
var_dump($match[1][0]);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货