
Oto kod:
Kod
<?php
if ($handle = opendir('a')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$myFile = "playlist.xml";
$fh = fopen($myFile, 'w') or die("Error!!");
fwrite($fh, "<playlist version='1' xmlns='http://xspf.org/ns/0/'><trackList>");
fwrite($fh, "<track><location>a/$file</location></track>");
fwrite($fh, "</trackList></playlist>");
fclose($fh);
}
}
closedir($handle);
}
?>
if ($handle = opendir('a')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$myFile = "playlist.xml";
$fh = fopen($myFile, 'w') or die("Error!!");
fwrite($fh, "<playlist version='1' xmlns='http://xspf.org/ns/0/'><trackList>");
fwrite($fh, "<track><location>a/$file</location></track>");
fwrite($fh, "</trackList></playlist>");
fclose($fh);
}
}
closedir($handle);
}
?>
Chyba nie dużo trzeba w nim zmieniać
