Código PHP:
<?php
$filter = ".mp3";
$directory = "Sonidos";
@$d = dir($directory);
if ($d) {
while($entry=$d->read()) {
$ps = strpos(strtolower($entry), $filter);
if (!($ps === false)) {
$items[] = $entry;
}
}
$d->close();
sort($items);
}
header("content-type:text/xml;charset=utf-8");
echo "<?xml version='1.0' encoding='UTF-8' ?>\n";
echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n";
echo " <title>Sonidos</title>\n";
echo " <info>http://www.forosdelweb.com/</info>\n";
echo " <trackList>\n";
for($i=0; $i<sizeof($items); $i++) {
echo " <track>\n";
echo " <annotation>".($i+1).". ".$items[$i]."</annotation>\n";
echo " <location>".$directory.'/'.$items[$i]."</location>\n";
echo " <info></info>\n";
echo " </track>\n";
}
echo " </trackList>\n";
echo "</playlist>\n";
Código PHP:
$directory = "Sonidos";
Código PHP:
$directory = "../";