If you collect a daily sentence of Kingsoft Mac, you must note that the audio address cannot be directly matched. The match is similar to the following string: iciba_common_top_onseconddelay(news.iciba.comadmintts2015-02-27213 ); therefore, you need to use a callback function to filter out the audio address. PhpQuery? Phprequire
The collection of Kingsoft word overlord daily sentence, it should be noted that, and can not directly match the audio address, matched is similar to this string: iciba_common_top_onSecondDelay (http://news.iciba.com/admin/tts/2015-02-27.mp3 ); therefore, you need to use a callback function to filter out the audio address. PhpQuery? Phprequire'
If you collect a daily sentence of Kingsoft Mac, you must note that the audio address cannot be directly matched. The matching is similar to the following string:
Iciba_common_top_onSecondDelay ('HTTP: // news.iciba.com/admin/tts/2015-02-27.mp3 ');
Therefore, you need to use a callback function to filter out the audio address. PhpQuery
Array (". en> a "," text "), // match Chinese" cn "=> array (". cn> a "," text "), // match audio" audio "=> array (". sound "," onmouseover ",'', function ($ v, $ k) {// callback function, used to match the audio address if (preg_match ('/http [^ \'] +/', $ v, $ arr) {$ v = $ arr [0];} return $ v ;}), // match the image "pic" => array ("a: eq (0)> img", "src "), // match the page address "page" => array ("a: eq (0)", "href"); $ data = QueryList: Query ($ url, $ rang, $ reg)-> jsonArr [0]; print_r ($ data );
Array ([en] => Courage is not the absence of fear, but rather the judgement that something else is more important than fear. [cn] => brave people do not have to fear anything, but identify things worth more attention than fear. [Audio] => http://news.iciba.com/admin/tts/2015-02-27.mp3?pic] => http://cdn.iciba.com/news/word/big_2015-02-27b.jpg? Rand = 8637 [page] => http://news.iciba.com/dailysentence/detail-1212.html)