Actualmente muestro todos los archivos ordenados desde el último ingreso hasta los más antiguos....
Código PHP:
   <?php
 
$filter = ".mp3";
 
$directory=$_GET['music'];
 
@$d = dir($directory);
if ($d) { 
    while($entry=$d->read()) {  
        $ps = strpos(strtolower($entry), $filter);
        if (!($ps === false)) {  
            $items[] = $entry; 
        } 
    }
    $d->close();
    rsort($items);
}
 
 
 
// third, the playlist is built in an xspf format
// we'll first add an xml header and the opening tags .. 
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>Sample PHP Generated Playlist</title>\n";
echo "    <info>http://www.jeroenwijering.com/</info>\n";
echo "    <trackList>\n";
 
// .. then we loop through the mysql array ..
for($i=0; $i<sizeof($items); $i++) {
 
$archivo=array_reverse(explode(".mp3",$items[$i]));
$archivo=$archivo[1];
 
    echo "        <track>\n";
    echo "            <annotation>".($i+1).". ".$archivo."</annotation>\n";
    echo "            <location>".$directory.'/'.$items[$i]."</location>\n";
    echo "            <info></info>\n";
    echo "        </track>\n";
}
 
// .. and last we add the closing tags
echo "    </trackList>\n";
echo "</playlist>\n";
 
?>    Código PHP:
   // .. then we loop through the mysql array ..
for($i=0; $i<sizeof($items); $i++) { 
    saludos
 
 

