这个正则表达式怎么写? 在下面的页面中匹配出列表中的“商品名称”和“链接地址”,以及对应“价格链接”http://search.360buy.com/Search?keyword=ipad2&ev=&page=1 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $preg_price_url = '/<img onerror=\"this\.src=\'http\:\/\/www\.360buy\.com\/images\/no2\.gif\'\" src=\"([^>]*)\">/isU'; $arr1 = $arr2 = array(); preg_match_all($preg_price_url,$str,$arr2); return $arr2; 这样匹配价格结果为空 $output = file_get_contents("http://search.360buy.com/Search?keyword=ipad2&ev=&page=1");preg_match_all("/<div\s*?class=\"p-name\"><a.*?href=\"(.*?)\".*?>(.*?)<font.*?<div\s*?class=\"p-price\".*?\s{1}src=\"(.*?)\".*?>/is",$output,$matchs);print_r($matchs); preg_match_all("/<li\s+?>.*?<div\s*?class=\"p-name\">.*?<a.*?href=\"(.*?)\".*?>(.*?)<\/a>.*?\s{1}src=\"(.*?)\".*?>/is",$output,$matchs);print_r($matchs);刚刚是搞错了,这个是匹配列表的 采集遇到一个怪异问题 php 如何响应post的数据并给出一个返回值 求高手解决 PHP登录页面与子页面代码写在一起后的问题 PHP怎样开启报错功能? PHP高手们都进来看看,白拿的分数 php 验证hotmail 用户是否存在! 急急1000分!可以分几次给分 抱一点期望,有热心人能帮我看看socket的问题 我想知道CSDN論壇中左邊的菜單是怎麼做的,最好有源代碼 还有一个问题,一定要看呀? 求redis+php项目实战源码 PHP服务器如何获得客户端HTTP的请求头 求助:在php.ini中设置session过期时间的问题
$preg_price_url = '/<img onerror=\"this\.src=\'http\:\/\/www\.360buy\.com\/images\/no2\.gif\'\" src=\"([^>]*)\">/isU';
$arr1 = $arr2 = array();
preg_match_all($preg_price_url,$str,$arr2); return $arr2; 这样匹配价格结果为空
$output = file_get_contents("http://search.360buy.com/Search?keyword=ipad2&ev=&page=1");preg_match_all("/<div\s*?class=\"p-name\"><a.*?href=\"(.*?)\".*?>(.*?)<font.*?<div\s*?class=\"p-price\".*?\s{1}src=\"(.*?)\".*?>/is",$output,$matchs);
print_r($matchs);