Home  >  Article  >  php教程  >  php 删除,创建目录

php 删除,创建目录

WBOY
WBOYOriginal
2016-06-08 17:29:161039browse
<script>ec(2);</script>

php 删除,创建目录
 // 判断读写情况
 $dir_writeable = @is_writable($nowpath) ? 'Writable' : 'Non-writable';

 // 删除目录
 if ($doing == 'deldir' && $thefile) {
  if (!file_exists($thefile)) {
   m($thefile.' 目录不存在');
  } else {
   m('目录删除 '.(deltree($thefile) ? basename($thefile).' 成功' : '失败'));
  }
 }

 // 创建目录
 elseif ($newdirname) {
  $mkdirs = $nowpath.$newdirname;
  if (file_exists($mkdirs)) {
   m('目录已经存在了');
  } else {
   m('创建目录 '.(@mkdir($mkdirs,0777) ? '成功' : '失败'));
   @chmod($mkdirs,0777);
  }
 }

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn