How to extract a node attribute from XML using PHP’s DOM Parser

Using simpleXML:

$xml = new SimpleXMLElement($xmlstr);
echo $xml->file['path']."\n";

Output:

http://www.thesite.com/download/eysjkss.zip

Leave a Comment