正在做一个有关获取价格的项目,匹配价格上出现一点问题,求指教

$fp = fopen("https://list.tmall.com/search_product.htm?q=hello kitty&sort=p&style=g&tmhkmain=0#J_Filter","r");
 $tmall = stream_get_contents($fp, 1024*1024);
    $tmall = urlencode($tmall);
     $rule = '/class%3D%22product%22(.*)class%3D%22product%22/s';
     preg_match($rule,$tmall,$result);
    print_r($result);
    exit;//打印不出来
     $goods_div=urldecode($result[0]);
     $rule_price='/<\/b>(.*)<\/em>/';
     $rule_url = '/detail.tmall.com.*" /';
     preg_match($rule_price,$goods_div,$price);
     preg_match($rule_url,$goods_div,$url);
     $url=explode('"', $url[0]);
     echo $price[1].$url[0];

是匹配的规则出错了吗

查看回复