File_get_contents second wave! Regular Expression Matching is very happy. The problem is that the content of file_get_contents is like this ..... & lt; spanclass = & quot; singer & quot; style = & quot; width: 95px; file_get_contents second wave! Regular Expression Matching is fun.
The problem is that the content of file_get_contents is as follows:
.....
Json
.....
Ajax
....
Php
/
Mysql
What I want to get is
PHP code
array("json","ajax","php+mysql");
Regular expression is really a piece of pain in my mind .....
------ Solution --------------------
PHP code
$ S = <TXT... json... ajax... php/mysqlTXT; preg_match_all ("/------ solution --------------------
PHP code
$s=<<
(.*)<\/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);