The copy() function copies files.
This function returns TRUE if successful and FALSE if failed.
copy(file,to_file)
| parameter | describe |
|---|---|
| file | Required. Specifies the files to be copied. |
| to_file | Required. Specifies the destination for copied files. |
Note: If the target file already exists, it will be overwritten.
<?phpecho copy("source.txt","target.txt");?>The above code will output:
1