I have a XM
L file as follows:
<bracelets>
<photo filename="b1.jpg" thumbnail="a1.jpg" description="aa" />
<photo filename="b2.jpg" thumbnail="a2.jpg" description="aa" />
<photo filename="b3.jpg" thumbnail="a3.jpg" description="aa" />
<photo filename="b4.jpg" thumbnail="a4.jpg" description="aa" />
</bracelets>
I want to fetch all image names into a .php
page.
I am using this now.
$bracelets = simplexml_load_file($bracelets_xml);
x = xmlDoc.getElementsByTagName('photo')[0].attributes;
for (i = 0; i < x.length; i++) {
document.write(x[i].childNodes[0].nodeValue);
}
But currently I am only able to fetch one image.
How can I fetch all images instead?