Forum Moderators: coopster
1. accept the input directory
2. read the directory/subdirectory
3. take all jpgs and mp3s into an array
4. generate a simple xml file adding the array values for a specific xml tag
is it possible to do it in php? Where do i begin? Is there some tutorials for this sort?
Appreciate your time and help
Thank you
Krs
<?php
$files = array();
$dir = opendir [uk2.php.net]('path to /directory/');
while ($read = readdir [uk2.php.net]($dir)) {
if ($read!='.' && $read!='..') {
$files[] = $read;
}
}
closedir [uk2.php.net]($dir);?>
<?php $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"; ?>
<?php
// Output as xml...
if (!empty($files)) {
foreach [uk2.php.net] ($files AS $ext) {
$xml .= '<tag>'.$ext.'</tag>';
}
}header('Content-Type: text/xml');
echo trim($xml);
?>
Something like that might get you started. And welcome to WebmasterWorld kristtee. :)
dc