文件的复制
<?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!