php 取得百度最新事件
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
发布: 2016-06-13 10:40:05
php 获得百度最新事件
1 | 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 ; }
|
登录后复制
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
作者最新文章
-
2025-02-26 03:58:14
-
2025-02-26 03:38:10
-
2025-02-26 03:17:10
-
2025-02-26 02:49:09
-
2025-02-26 01:08:13
-
2025-02-26 00:46:10
-
2025-02-25 23:42:08
-
2025-02-25 22:50:13
-
2025-02-25 21:54:11
-
2025-02-25 20:45:11