public function renames(){ if(request()->isAjax()){ $file = iconv('UTF-8','GB2312',urldecode(input('file'))); $filename = input('filename'); $newfile = iconv('UTF-8','GB2312',dirname($file).DS.$filename); if(file_exists($newfile)){//判断名称是否已经存在 return…
显示文件用到的函数有 1.urlencode($str):编码URL字符串,便于将字符串编码并将其用于URL的请求部分 2.urldecode($str):解码已经编码的URL字符串,返回解码后的字符串 3.iconv('GB2312','UTF-8',$str):将字符串$str,编码由GB2312转变为utf-8:解决中文乱码 4.file_exists($path):检查文件或目录是否存在,$path规定要检查的路径 5.stripos($str,$find,$start):查找$find…
public function edit(){ $file = iconv('UTF-8','GB2312',urldecode(input('file'))); if(empty($file)|| !file_exists($file)){ $this->error('操作异常'); } $arr = ['.PHP', '.CSS', '.JS', '.XML', '.HTML', '.HTACCESS','.TXT','.JSON']; $exc = strtoupper(substr($f…
1.is_dir():检查指定的文件是否是目录 2.scandir():返回指定目录中的文件和目录数组 3.unlink():删除文件,如果删除的文件不存在会报错,加@抑制报错 public function del(){ if(request()->isAjax()){ $file = iconv('UTF-8','GB2312',urldecode(input('file'))) if(is_dir($file)){ $arr = scandir($file);//列出$file目录中的文件…
public function download($currdir = null){ $file = urldecode($currdir); $file = iconv('UTF-8', "GB2312", $file); if (!file_exists($file)) { $this->error("文件不存在"); } //basenamecn 是common文件自定义的方法 $filename = basenamecn(iconv('GB2312',…
原文地址:http://hi.baidu.com/benchoi/item/c1f531f5f1367b0b85d2785b 批处理实现文件批量重命名并自动加递增序列号 有时我们想把一些图片批量重命名的时候,可能会想到用acdsee7.0以上的版本来实现.也有人可能会在我的电脑里,打开文件夹,全选图片文件,然后按着ctrl键不放,在第一个图片上右健单击重命名,放开左健,把文件的文件名了文件类型写好,如list.jpg.你写好文件名好,把鼠标住空白处一点,就批量改成了list(1).jpg.lis…
ThinkPHP5.0开发手册地址 https://www.kancloud.cn/manual/thinkphp5/118003 此博文仅仅作为个人笔记存储,没有广告,宣传的意图…
(13)重命名文件夹 ① 重命名文件夹通过 rename($oldname,$newname) 实现 ② 检测文件夹名是否符合规范 ③ 检测当前目录中是否存在同名文件夹名称,如果不存在则重命名成功 index.php: <?php require 'dir.func.php'; require 'file.func.php'; require 'common.func.php'; $path = 'file'; $path = @$_REQUEST['path']?@$_REQUEST['pat…
rename($oldname,$newname) 重命名文件或目录 <<<EOF EOF; 使用heredoc 技术,来部分实现界面与代码的准分离 重命名时,需要验证新文件名的合法性 index.php: <?php require 'dir.func.php'; require 'file.func.php'; require 'common.func.php'; $path = 'file'; $info = readDirectory($path); $act = @$_R…
本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn [转自]http://www.xifenfei.com/2012/08/oracle%e7%94%a8%e6%88%b7%e9%87%8d%e5%91%bd%e5%90%8d.html 从oracle 11.2.0.2开始提供了用户重命名的新特性,在以前的版本中,如果想对用户重命名,一般来说是先创建一个新的用户并授权,然后将原用户下的所有对象导入,然后删除旧的用户!…