Hi. I am trying to have PHP dynamically create an xml file based on the contents of a directory.
For example, i have two directories “Dir1” and “Dir2” In each of these directories are several pictures “Dir1-image1.jpg, Dir1-image2.jpg etc” and “Dir2-image1.jpg, Dir2-image2.jpg etc”.
The resulting XML should look like:
[code]
<images>
<imagebatch>
<dir1>dir1-image1.jpg</dir1>
<dir2>dir2-image1.jpg</dir2>
</imagebatch>
<imagebatch>
<dir1>dir1-image2.jpg</dir1>
<dir2>dir2-image2.jpg</dir2>
</imagebatch>
</images>
The images must be listed in alphabetical order (which i think is the default anyway), and the xml must be saved as a separate file called images-auto.xml.
I have found many tutorials on google on how to do each part (Read content of a directory, create xml files, save xml files etc), but i have spent far too long pulling them together with absolutley no success. Nothing even gets close.
Can anyone help?