<?php
function deltree($pathdir) {
$file = '';
if(!is_empty_dir($pathdir))//如果不是空的
{//否则读这个目录,除了.和..外
}
function is_empty_dir($pathdir)
{
//判断目录是否为空,我的方法不是很好吧?只是看除了.和..之外有其他东西不是为空
$d=opendir($pathdir);
$i=0;
closedir($d);
if($i>2){return false;}
else return true;
}
$get_filename = deltree('aaa');
echo substr($get_filename,0,-1);
?>
下一篇:PHP判断文件夹是否存在和创建文件夹的方法