问题是这样的 file_get_contents 出来的内容是这样
.....
json
.....
ajax
....
php
/
mysql
我想得到的结果是
- PHP code
array("json","ajax","php+mysql");
求正则 正则实在是心头的一块隐痛.....
------解决方案--------------------
- PHP code
$s = <<< TXT ..... json ..... ajax .... php / mysql TXT; preg_match_all("/------解决方案--------------------
- PHP code
$s=<< json ..... ajax ajax .... php / mysql html; $s= str_replace('/','',$s); preg_match_all('/]*>(.*)<\/span>/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);