function isMp3($filename){
return substr($filename, -4) === '.mp3';
}
function cmpmtime($a, $b)
{
return filemtime($b) - filemtime($a);
}
$d = dir(getcwd());
$files = array();
while (false !== ($filename = $d->read())) {
if(isMp3($filename)){
$files[] = $filename;
}
}
$d->close();
usort($files, "cmpmtime");
foreach ($files as $filename) {
$playlist .= $filename.'|';
}
echo "mp3=" . substr($playlist, 0, strlen($playlist) - 1);
?>
width=500
height=500
autoplay=1
loop=1