Copy "source.txt" to "target.txt":
<?php
echo copy("source.txt","target.txt");
?>
The copy() function copies a file.
Note: If the to_file file already exists, it will be overwritten.
copy(
from_file,
to_file,
context)
Parameter | Description |
---|---|
from_file | Required. Specifies the path to the file to copy from |
to_file | Required. Specifies the path to the file to copy to |
context | Optional. Specifies a context resource created with stream_context_create() |
Return Value: | TRUE on success, FALSE on failure |
---|---|
PHP Version: | 4.0+ |
PHP Changelog: | PHP 5.3 - Added context parameter |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!