note 40037 added to function.copy
| From: | php-general at lists dot php dot net | Date: | Thu, 19 Feb 2004 16:03:01 +0000 |
| Subject: | note 40037 added to function.copy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65406@lists.php.net to get a copy of this message | ||
To avoid warnings if destination file already exists but can still be overwritten, you don't
need lots of code. Just use the "@" operator which filters all such warnings from the
generated output...
<?php
if (!@copy($src, $dst)) {
echo $src, ' could not be copied to ', $dst;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.copy.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40037
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40037&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40037&report=yes
Search -- http://master.php.net/manage/user-notes.php