Hi all
I'm hoping someone can help me with some code snippets.
Oldtime programmer - just trying to revisit coding so know principles of what to do but not how to.
I am creating a pic gallery in flash (i am using a variation of someone else's) which uses an xml file containing the filename of pics to display.
I will refresh the gallery every day but I do not want to keep editing the xml file. So I thought I could write a little program in php which will read the contents of a specific directory and rewrite the xml file.
Anyone help me with the php code??
thanks
george
how can i automate maintainence of xml files
Moderator: General Moderators
-
rameshmrgn
- Forum Newbie
- Posts: 15
- Joined: Sat Jun 17, 2006 1:01 am
an example of what I was referring to, but using glob instead of opendir/readddir
Code: Select all
<?php
$images = glob ('/path/to/images/*.{jpg,gif,png,etc}', GLOB_BRACE);
echo "<?xml version=\"1.0\"?>\n\t<files>\n";
foreach ($images as $img) {
echo "\t\t<file>{$img}</file>\n";
}
echo "\t</files>\n";
?>Automating XML maintenance
Guys
you are awesome! I really appreciate the pointers, now to research your suggestions and cut some code...
well not now - it's way past my bedtime, but tomorrow after work
thank you all
george
you are awesome! I really appreciate the pointers, now to research your suggestions and cut some code...
well not now - it's way past my bedtime, but tomorrow after work
thank you all
george