文件夹是否为空
1:
2:$root = dirname(__FILE__);$root = str_replace("\", "/", $root);$path = $root.'/test/';$isempty = file_exit();//检查目录是否为空function file_exit($filelastname = ''){global $path;if($filelastname != ''){ $handle = opendir($path.$filelastname);}else{ $handle = opendir($path); }while (false !== ($file = readdir($handle))) { if($file == '.' || $file == '..'){ continue; } $file_array[] = $file;}if($file_array == NULL){//没有文件 closedir($handle); return false;}closedir($handle);return true;//有文件}