您好,欢迎访问一九零五行业门户网

file_get_contents第二波!正则匹配很欢乐解决思路

file_get_contents第二波!正则匹配很欢乐
问题是这样的 file_get_contents 出来的内容是这样
.....
json
.....
ajax
....
php
/
mysql
我想得到的结果是
php codearray(json,ajax,php+mysql);
求正则 正则实在是心头的一块隐痛.....
------解决方案--------------------
php code$s = json.....ajax....php/mysqltxt;preg_match_all(/(.+), $s, $r);print_r($r[1]);
------解决方案--------------------
php code $s=json.....ajaxajax....php/mysqlhtml; $s= str_replace('/','',$s);preg_match_all('/]*>(.*)/isu',$s,$m);foreach($m[1] as $v){ $v=preg_replace('/]+>/','',$v,-1,$count); if($count>2) $arr[]=join('+',preg_split(/[\r\n]+/,$v,-1,preg_split_no_empty)); else $arr[]=trim($v); }print_r($arr);

其它类似信息

推荐信息