Urgent Help !!~ How to use PHP to obtain the content of the CDATA section in the RSS reader is as follows ~ Reader address: rss.weather.gov. hkrssCurrentWeather_uc.xml I want to get the temperature, ultraviolet rays, relative humidity and other content in CDATA. how can I deal with it ~? ------ Solution -------------------- PHPcode $ strfile_get_co urgent help !!~ How to use PHP to obtain the content of CDATA in RSS reader
Example ~
Reader address: http://rss.weather.gov.hk/rss/CurrentWeather_uc.xml
How can I get the temperature, ultraviolet rays, and relative humidity in CDATA ~?
------ Solution --------------------
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]);
------ Solution --------------------
The Internet is really a good thing! Reference: Search for "how to read with simpleXML" Content in"
PHP code
$ Url = 'http: // response = simplexml_load_file ($ url, 'simplexmlelement', LIBXML_NOCDATA); print_r ($ xml-> channel-> item-> description );