您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

!怎么用PHP获取RSS阅读器里CDATA部分的内容

2025/10/11 7:40:06发布63次查看
紧急求助!!~如何用php获取rss阅读器里cdata部分的内容
如题~
阅读器地址:http://rss.weather.gov.hk/rss/currentweather_uc.xml
我要获取cdata里温度,紫外线,相对湿度等内容,该如何搞定~?
------解决方案--------------------
php code$str=file_get_contents('http://rss.weather.gov.hk/rss/currentweather_uc.xml');preg_match('/\[cdata\[\s*(.*)
/uis',$str,$match);print_r($match[1]);
------解决方案--------------------
互联网真是好东西啊!参考文档:搜索“用simplexml 如何读取 中的内容呢”

php code$url = 'http://rss.weather.gov.hk/rss/currentweather_uc.xml';$xml = simplexml_load_file($url, 'simplexmlelement', libxml_nocdata); print_r($xml->channel->item->description);

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product