php专区

 首页 > php专区 > PHP应用 > php函数大全 > php 删除目录及所有文件 - php函数

php 删除目录及所有文件 - php函数

分享到:
【字体:
导读:
          functiondel($name){if(!is_dir($name)){return@unlink($name);}else{$dir=opendir($name);while($file=readdir($dir)){if(($file== 39;...

php 删除目录及所有文件

  1. function del($name) { 
  2.   if (!is_dir($name)) { 
  3.    return @unlink($name); 
  4.   } else { 
  5.    $dir = opendir($name); 
  6.    while$file = readdir( $dir ) ) { 
  7.     if (($file=='.')||($file=='..')) continue
  8.     if (is_dir($name.'/'.$file)) $this->del($name.'/'.$file); 
  9.     else echo basename($file), @unlink($name.'/'.$file) ? ' Success!' : ' False.'''
  10.    } 
  11.   closedir($dir); 
  12.   } 
  13.   return @rmdir($name); 
  14.  } 
分享到:
php 截取字符串函数(中文字符串) - php函...
php 截取字符串函数(中文字符串) php 截取字符串函数(中文字符串) 这是一款php 截取字符串函数哦,这是一款支持中文字符串哦,它可以截取html与中西文,等混合的内容,并且把html标签不算在字符截取之内,如果html标签没有闭合,程序将自动过滤多余的标签。 方法一: function mysu...
php取得文件扩展名 - php函数
php取得文件扩展名 function GetFiletype($filename){   $filer=explode(".",$filename);   $count=count($filer)-1;   return strtolower(".".$filer[$count]);  } 
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……