Ben aşağıdaki komut ile bir çalma listesi oluşturmak:
<?php
$dir = './music';
$url = 'music';
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
echo '<playlist>';
if (is_dir($dir)) {
$dp = opendir($dir);
while (false !== ($file = readdir($dp))){
if ('mp3'==strtolower(substr($file, -3))) {
printf('<sound src="%s/%s" stream="true" soundbuffer="8">%s</sound>', $url, $file, str_replace('_', ' ', substr($file, 0, -4)));
echo "\n";
}
}
closedir($dp);
}
echo '</playlist>';
How do I get the artist and length from each mp3 file?
Şimdiden teşekkürler