I have an XML document that I need to load and in the document it has several image sizes. But, I only need the medium image URL returned. How would I go about getting that?
This is the XML code:
<?xml version="1.0" encoding="utf-8"?>
<ipl status="">
<sizes>
<image size="small">s/64654587.jpg</image>
<image size="medium">m/64654587.jpg</image>
<image size="large">l/64654587.jpg</image>
</sizes></ipl>
With SimpleXML things are easy:
If you need to read XML from the file use
simplexml_load_fileinstead.http://php.net/manual/en/function.simplexml-load-string.php
http://php.net/manual/en/function.simplexml-load-file.php