Let's take a look at the PHP copy function tutorial below.
Copy
(PHP 4, PHP 5)
Copy-Copy files
Describe
Boolean copy (string $ Source, string $ dest [, resource $ background])
Dest A copy source of the file.
If you want to move the file, use the rename () function.
Parameters
Source
The source file for the path.
Dest
Destination path. If Dest is a URL, the copy operation may fail if the wrapper does not support overwriting the existing file.
Warning
If the target file already exists, it will be overwritten.
Background
Establish Stream_context_create () within the valid range of resources.
return value
Returns TRUE or FALSE for successful failure.
Modify
Release Notes
5.3.0 support for time.
4.3.0 sources and dest now possible URLs if "open wrapper" is enabled. See the fopen () function for more details.
Instance
Example of # 1copy ()
$file = ' example.txt ';
$newfile = ' Example.txt.bak ';
if (!copy ($file, $newfile)) {
echo "Failed to copy $file ... n";
}
?>
http://www.bkjia.com/PHPjc/445489.html www.bkjia.com true http://www.bkjia.com/PHPjc/445489.html techarticle Let's take a look at the PHP copy function tutorial below. Copy (PHP 4, PHP 5)-Copy file Description Boolean copy (string $ Source, string $ dest [, resource $ background]) to make ...