清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | <?php class file{ static public function ShowDir( $path , $level =0){ $dir =opendir( $path ); while (( $file =readdir( $dir )) !==false){ if ( $file != '.' && $file != '..' ){ $filepath = $path . '/' . $file ; for ( $i =0; $i < $level *5; $i ++){ echo " " ; } echo $file . '<br>' ; if ( is_dir ( $filepath )) { static ::ShowDir( $filepath , $level + 1); } } } closedir ( $dir ); } static public function DeleteDir( $path ){ $dir =opendir( $path ); while (( $file =readdir( $dir )) !== false){ if ( $file != '.' && $file != '..' ){ $filepath = $path . '/' . $file ; if ( is_dir ( $filepath )){ self::DeleteDir( $filepath ); } else { unlink( $filepath ); } } } closedir ( $dir ); rmdir ( $path ); } } ?> |