September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool copy(string from, string to)
Copies a file.
Returns:
TRUE on success; FALSE on failure
Description:
Makes a copy of the specified file. Depends on file permissions—if the user your script runs as is not allowed to access the file and/or directories required to copy the file, the call fails.
Warning:
3.0.10, 3.0.11: Seems to have problems copying uploaded files (reported for Windows NT SP4).
Example:
$file = "file";
$file_new = $file . ".backup";
if (!copy($file, $file_new)) {
echo ("Could not create a backup copy of the file");
}
|
Read now
Unlock full access