Heim >Backend-Entwicklung >PHP-Tutorial >php 取得百度最新事件

php 取得百度最新事件

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 10:40:051000Durchsuche

php 获得百度最新事件

function getBaiduHotKeyWord()    {     $templateRss = file_get_contents('http://top.baidu.com/rss_xml.php?p=shijian');     If (preg_match('/<table>(.*)<\/table>/is', $templateRss, $_description)) {     $templateRss = $_description[0];     $templateRss = str_replace("&", "&", $templateRss);     }    $templateRss = "<?xml version=\"1.0\" encoding=\"GBK\"?>".trim($templateRss);    $xml = simplexml_load_String($templateRss);    foreach ($xml->tbody->tr as $temp) {     if (!empty ($temp->td->a)) {       $keyArray [] = trim(($temp->td->a));     }    }    return $keyArray;    } 

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn