Makes a copy of the file source to dest. Returns TRUE on success or FALSE on failure.
Example 1. copy() example
<?php if (!copy($file, $file.'.bak')) { echo "failed to copy $file...<br />\n"; } ?>
Note: As of PHP 4.3.0, both source and dest may be URLs if the "fopen wrappers" have been enabled. See fopen() for more details. If dest is a URL, the copy operation may fail if the wrapper does not support overwriting of existing files.
Warning
If the destination file already exists, it will be overwritten.
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?