Duplicate “source.txt” to “target.txt”.
<?php echo copy(“source.txt”,“target.txt”); ?> |
The copy() function duplicates a file.
Note: If the destination file already exists, it will be overwritten.
copy(from_file, to_file, context) |
Parameter |
Description |
from_file |
Mandatory. Specifies the path of the file to be copied. |
to_file |
Mandatory. Specifies the path where the file should be copied to. |
context |
Optional. Specifies a context resource created using |
Return Value: |
Returns |
PHP Version: |
4.0+ |
PHP Changelog: |
PHP 5.3 introduced the |