Blogger Information
Blog 87
fans 0
comment 0
visits 59076
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
第七章:文件与目录的常见操作
黄忠倚的博客
Original
861 people have browsed it

实例

<?php
//1.删除文件:unlink(file)
//unlink('temp.php') or die('删除失败');

//2.复制copy(old,new)
// copy('maxim.txt','../0419/maxim01.txt') or die('复制失败');
//3.更名:rename(old,new):同一目录下就是更名
// rename('maxim01.txt','maxim02.txt') or die('更名失败');
//4.移动:rename(old,new):不同目录下就是移动
// rename('file3.txt',__DIR__.'/../0418/file3.txt')or die('移动失败');
// rename('file2.txt','../0418/file2.txt')or die('移动失败');

//5.目录创建:mkdir(dirname)
// mkdir('admin');
// rename('file.txt','admin/file.txt')or die('移动失败');

// //6.目录删除:rmdir(dirname)
// unlink('admin/file.txt');  //文件删除
rmdir('admin');  //目录删除

运行实例 »

点击 "运行实例" 按钮查看在线实例


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post