Welcome Guest, Not a member yet? Register   Sign In
need help with cdata in xml
#1

[eluser]new_igniter[/eluser]
Hello,
I am trying to use longurl.org to reverse a bunch of tiny links

Code:
$urlLink = $somePassedURLthroughFunction;
        $fileProxURL = "http://api.longurl.org/v1/expand?url=$urlLink";
        $data = file_get_contents($fileProxURL);
        $xml = new SimpleXMLElement($data);

        foreach($xml as $item)
        {
            print_r($item);
        }

and getting back

Code:
<response>
    <long_url>&lt;![CDATA[http://bit.ly/dotym]]></long_url>
</response>

How do I fetch the <log_url> value? OR a better question, in PHP what is going on with that?
Why is that <CDATA tag and how do I handle it?




Theme © iAndrew 2016 - Forum software by © MyBB