帮忙解决个php正则
html code
性别:尤物一枚 骚年一个
请帮忙用preg_match_all 从(.*)写个正则, 取出里边里的字符,
整段代码只要里的字符赤裸裸的: '尤物一枚 骚年一个' 其他多余的字符和标签都不要,
因为有可能一个, 有可能多个, 所以请用是就匹配的代码
最重要的 是定要 preg_match_all(/(.*?)/is,$path,$str); 从开始截取 到结束 然后里边正则取字符
谢谢各位
------解决方案--------------------
先取出每个li,然后再匹配a标签
preg_match_all(/(.*?)/is,$path,$str);
foreach($str[1] as $v){
preg_match_all('/>([^/isu',$v,$m[]);
}
print_r($m);
------解决方案--------------------
php code$path='
性别:尤物一枚 骚年一个';preg_match_all(/(.*?)/si,$path,$str);preg_match_all(/target=\_blank\>(.*?)/si,$str[1][0],$content);print_r($content[1]);
