Home > php教程 > PHP源码 > php 删除,创建目录

php 删除,创建目录

WBOY
Release: 2016-06-08 17:29:16
Original
1063 people have browsed it
<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);
  }
 }

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template