日期:2012-05-15  浏览次数:20402 次

php如何获取文件夹名字其实很简单,只要记住一两个函数就可以了!


$dir = "message/";  // 文件夹的名称

if (is_dir($dir)){
    if ($dh = opendir($dir)){
        while (($file = readdir($dh)) !== false){
            echo "文件名: $file <br>";
        }
        closedir($dh);
    }
}