Description
string readdir ( resource dir_handle)
Returns the filename of the next file from the directory. The filenames are returned in the order in which they are stored by the filesystem.
输出的排序和文件系统有关系。你可以自己暂存在ARRAY中,然后排序后输出。
string readdir ( resource dir_handle)
Returns the filename of the next file from the directory. The filenames are returned in the order in which they are stored by the filesystem.
输出的排序和文件系统有关系。你可以自己暂存在ARRAY中,然后排序后输出。
while (($file=readdir($handle))<>"") {
$dir[]=$file;
}
closedir($handle);
asort($dir);
foreach($dir as $name){
echo $name."<br>";
}
//use array to do this