images from XML file
Posted: Fri Dec 17, 2010 8:27 am
Hi all,
Very simple question im sure, i want to gather an image from an xml file:
I am using this php method to gather the info, but the images will not show?
All works as i need, but images just get ignored. Im guessing SimpleXMLElement method cant do what i want. Any ideas on what i can do to get this working. The simplest way possible as its only for internal use.
Any help would be great! Im a real novice, so sorry if this is painfully obvious.
Cheers,
Grant
Very simple question im sure, i want to gather an image from an xml file:
Code: Select all
<story>
<publishdate>17 December 2010</publishdate>
<title>Story 3 title</title>
<content>Lets get this done <strong>2</strong></content>
<image><img src="images/demo.jpg" width="570" height="330" /></image>
</story>
Code: Select all
$xml = new SimpleXMLElement($xmlstr);
echo $xml->story[0]->title
echo $xml->story[0]->image
etc
etc
Any help would be great! Im a real novice, so sorry if this is painfully obvious.
Cheers,
Grant