好得很程序员自学网

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

php递归删除目录所有文件 - php文件操作

php递归删除目录所有文件

<meta http-equiv= "content-type"  content= "text/html; charset=gb2312" >  <?php  function  tree( $directory )   {   $mydir =dir( $directory );   echo   "<ul> " ;   while ( $file = $mydir ->read()){   if (( is_dir ( "$directory/$file" ))  and  ( $file != "." )  and  ( $file != ".." ))   { echo   "<li><font color=" #ff00cc "><b>$file</b></font></li> " ;   tree( "$directory/$file" );   }   else { //开源代码phpfensi.com        $a  =  explode ( '.' , $file );       if ( $a [1] ==  'html'  ||  $a [1] ==  'htm' )     {           //unlink($file);                echo   "<li>$file</li> " ;           }             }   }  echo   "</ul> " ;   $mydir ->close();   }   //开始运行     echo   "<h2>目录为粉红色</h2><br> " ;   tree( "./" );   ?> 

查看更多关于php递归删除目录所有文件 - php文件操作的详细内容...

  阅读:69次