mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Simplified example
Added note about windows compatability git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@167602 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
30ecb30f1e
commit
0127ad913f
1 changed files with 13 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.copy">
|
||||
<refnamediv>
|
||||
|
@ -21,8 +21,11 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (!copy($file, $file.'.bak')) {
|
||||
echo "failed to copy $file...<br />\n";
|
||||
$file = 'example.txt';
|
||||
$newfile = 'example.txt.bak';
|
||||
|
||||
if (!copy($file, $newfile)) {
|
||||
echo "failed to copy $file...\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
@ -46,6 +49,13 @@ if (!copy($file, $file.'.bak')) {
|
|||
If the destination file already exists, it will be overwritten.
|
||||
</para>
|
||||
</warning>
|
||||
<note>
|
||||
<para>
|
||||
Windows Compatability Note: If you copy a file with no size,
|
||||
<function>copy</function> will return false, but the file will be correctly
|
||||
copied.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>move_uploaded_file</function>,
|
||||
<function>rename</function>, and the section of the manual
|
||||
|
|
Loading…
Reference in a new issue