Blogger Information
Blog 6
fans 0
comment 0
visits 5183
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
文件的移动复制重命名
Pythonxzm
Original
1261 people have browsed it
文件的复制
<?php
   //旧文件名
   $filename = '123456.old';

   //新文件名
   $filename2 = 'new_' . $filename;

   //修改名字
   copy($filename, $filename2);
?>

文件的重命名
<?php
   //旧文件名
   $filename = 'test.txt';

   //新文件名
   $filename2 = 'demo.old';

   //复制文件
   rename($filename, $filename2);
?>

文件的删除
<?php
   $filename = 'test.txt';

   if (unlink($filename)) {
       echo  "删除文件成功 $filename!\n";
   } else {
       echo "删除 $filename 失败!\n";
   }
?>


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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!