好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

如何用php创建与删除多级目录函数 - php函数

如何用php创建与删除多级目录函数

  function  deldir( $dir )   {       $dh =opendir( $dir );       while  ( $file =readdir( $dh ))      {      if ( $file != "."  &&  $file != ".." )     {   $fullpath = $dir . "/" . $file ;   if (! is_dir ( $fullpath ))   {   unlink( $fullpath );   }   else   {   $this  -> deldir( $fullpath );   }     }      }       closedir ( $dh );       if ( rmdir ( $dir ))      {   return  true;      }       else      {   return  false;      }   }     function  createFolder( $path )   {       if  (! file_exists ( $path )){      createFolder(dirname( $path ));       mkdir ( $path , 0777);   }   } 

查看更多关于如何用php创建与删除多级目录函数 - php函数的详细内容...

  阅读:47次