/**
* Get hot words from Baidu
* @user Little Jay
* @from http://www.isharey.com/?p=354
* @return Array returns the hot Word data from Baidu (array return)
*/
Java code
/**
* Get hot words from Baidu
* @user Little Jay
* @from http://www.isharey.com/?p=354
* @return Array returns the hot Word data from Baidu (array return)
*/
function Getbaiduhotkeyword () { $templateRss = file_get_contents (' http://top.baidu.com/rss_xml.php?p=top10 '); If (Preg_match ('/<table> (. *) <\/table>/is ', $templateRss, $_description)) { $templateRss = $_ Description [0]; $templateRss = Str_replace ("&", "&", $templateRss); } $templateRss = "<?xml version=\" 1.0\ "encoding=\" Gbk\ "?>". $TEMPLATERSS; $xml = simplexml_load_string ($TEMPLATERSS); foreach ($xml->tbody->tr as $temp) { if (!empty ($temp->td->a)) { $keyArray [] = Trim (($temp Td->a)); } } return $keyArray; }