has been resolved, a bit messy, the speed is OK.
(' Possible deep recursion attack '); } foreach ($array as $key = + $value) {if (Is_array ($value)) {arrayrecursive ($array [$key], $funct Ion, $apply _to_keys_also); } else {$array [$key] = $function ($value); } if ($apply _to_keys_also && is_string ($key)) {$new _key = $function ($key); if ($new _key! = $key) {$array [$new _key] = $array [$key]; Unset ($array [$key]); }}} $recursive _counter--;} /************************************************************** * * Convert an array to a JSON string (Chinese language compatible) * @param array $array the arrays to be converted * @ The JSON string converted by the return string * @access public * *************************************************************/function JSON ($array) {arrayrecursive ($array, ' UrlEncode ', true); $json = Json_encode ($array); Return UrlDecode ($json);}
url:http://www.hkxy.edu.cn/
:
I want to extract. Offer_box_wide1 the text and href of the A element how to break?
Reply content:
has been resolved, a bit messy, speed on the line.
(' Possible deep recursion attack '); } foreach ($array as $key = + $value) {if (Is_array ($value)) {arrayrecursive ($array [$key], $funct Ion, $apply _to_keys_also); } else {$array [$key] = $function ($value); } if ($apply _to_keys_also && is_string ($key)) {$new _key = $function ($key); if ($new _key! = $key) {$array [$new _key] = $array [$key]; Unset ($array [$key]); }}} $recursive _counter--;} /************************************************************** * * Convert an array to a JSON string (Chinese language compatible) * @param array $array the arrays to be converted * @ The JSON string converted by the return string * @access public * *************************************************************/function JSON ($array) {arrayrecursive ($array, ' UrlEncode ', true); $json = Json_encode ($array); Return UrlDecode ($json);}
url:http://www.hkxy.edu.cn/
:
I want to extract. Offer_box_wide1 the text and href of the A element how to break?
The simplest way is to phpquery.
Refer to php simple HTML DOM Parser
http://simplehtmldom.sourceforge.net/
You can manipulate HTML as flexibly as the jquery selector.