不知道怎样去找突破口,整天这样的写 代码 很没动力。
/** * 删除 文件 或目录 * * @param string $path * @return boolean * @since v1.0 * @create 2012-10-12 */ function rm( $path ){ if( is_dir( $path ) ){ if( rmdir($path)==false ){ if( $h=opendir($path) ){ while( $f=readdir($h) ){ if( $f!='.' && $f!='..' ){ $file = rtrim($path,'/').'/'.$f; rm( $file ); } } closedir($h); return rmdir($path); } }else{ return true; } }else{ return unlink( $path ); } }
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did7844