首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

文件夹是不是为空

2012-09-07 
文件夹是否为空1:2:$root dirname(__FILE__)$root str_replace(\\, /, $root)$path $root./t

文件夹是否为空
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;//有文件}

热点排行