Get Baidu's buzzword * @ user Xiaojie * @ fromwww.isharey.com? P354 * @ returnarray returns Baidu's buzzword data (array return) ***** get Baidu's buzzword * @ user Xiaojie * @ fromwww.isharey.com? P354 * @ returnarray .../**
* Get Baidu's buzzwords
* @ User Xiaojie
* @ From http://www.isharey.com /? P = 354
* @ Return array returns Baidu's buzzword data (array return)
*/
Java code
/**
* Get Baidu's buzzwords
* @ User Xiaojie
* @ From http://www.isharey.com /? P = 354
* @ Return array returns Baidu's buzzword data (array return)
*/
function getBaiduHotKeyWord() { $templateRss = file_get_contents('http://top.baidu.com/rss_xml.php?p=top10'); If (preg_match('/
(.*)<\/table>/is', $templateRss, $_description)) { $templateRss = $_description [0]; $templateRss = str_replace("&", "&", $templateRss); } $templateRss = "
" . $templateRss; $xml = simplexml_load_String($templateRss); foreach ($xml->tbody->tr as $temp) { if (!empty ($temp->td->a)) { $keyArray [] = trim(($temp->td->a)); } } return $keyArray; }