Need to get CDATA Out of XML File to Text

PHP 5.2.6

Need some help. This code used to work just fine. Suddenly it’s not working anymore and I’m not sure why.

simpleXML response contains CDATA. I only want to display is the CDATA within the XML file as a text file. I’m using cURL to connect to the XML server.

I’m Using preg_match_all to get and parse all of the data within the CDATA brackets:

TheData = preg_match_all(’/<![CDATA[(.*?)]]>/’, $Response, $url);
header(‘refresh:5; url=passOn’);
$testing = $url[1][0];
$filename = “CDATA.txt”;
$ifp = fopen($filename, “wb” );
fwrite($ifp, $testing);

If $TheData is empty, I have it try again in 5 seconds. Well, this used to work just fine. Now for some reason, it never pulls any data. It just keeps refreshing every 5 seconds continually.

For php 5.2.6, is this still a valid way to pull this? Why doesn’t it work any longer?

Thanks for your help.


Sponsor our Newsletter | Privacy Policy | Terms of Service