PHP copy() Function
Complete PHP Filesystem Reference Manual
Definition and Usage
The copy() function copies a file.
Returns TRUE on success, or FALSE on failure.
Syntax
copy(file,to_file)
| Parameters | Description |
|---|---|
| file | Required. Specifies the file to copy. |
| to_file | Required. Specifies the destination of the copied file. |
Tips and Notes
**Note:** If the destination file already exists, it will be overwritten.
Example
The code above will output:
1
Complete PHP Filesystem Reference Manual