I have an XML file that I am trying to get variables off with PHP. The XML file looks like this:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcq="http://purl.org/dc/terms/" xmlns="http://www.skype.com/go/skypeweb">
<Status rdf:about="urn:skype:skype.com:skypeweb/1.1">
You can view the full XML file here: http://mystatus.skype.com/username.xml
I used the simplexml extension to convert the xml input into the PHP object $xml
. When I attempt to navigate later in the file with:
$variable = $xml->rdf:RDF->Status->presence;
It gives me an error because of the colon in "rdf:RDF":
Parse error: syntax error, unexpected ':'
How can I either escape the colon, or navigate later in the file without changing the XML file?