0
我想glob
回到同一文件的順序(排序)作爲opendir
如何讓glob()返回與opendir()相同的文件順序?
例如:
$files = glob('/home/web/public_html/audio/*.mp3');
foreach($files as $file) {
echo $file;
break;
}
if ($handle = opendir('/home/web/public_html/audio/')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
echo "$entry\n";
break;
}
}
closedir($handle);
}
?>
有沒有辦法做到這一點?
我試過,並不匹配'opendir' – 2012-07-19 12:08:52
你可以發佈他們兩個的輸出嗎?你有沒有發現任何模式在他們的排序? – 2012-07-19 13:23:31