bool copy ( string $source, string $dest );
将source 内容复制到dest。
source - 源文件的路径。
链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-copy.html
来源:LearnFk无涯教程网
dest - 目标路径,如果dest是URL,则如果包装不支持覆盖现有文件,则复制操作可能会失败。
成功时返回TRUE,失败时返回FALSE。
<?php $file='/usr/home/guest/example.txt'; $newfile='/usr/home/guest/example.txt.bak'; if (!copy($file, $newfile)) { echo "failed to copy $file...\n"; }else { echo "copied $file into $newfile\n"; } ?>
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)