PHP: copy - Manual in Deutsh
PHP: copy - Manual in French
PHP: copy - Manual in Polish

You Are At PHP: copy - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

copy

(PHP 3, PHP 4, PHP 5)

copy -- Copies file

Description

bool copy ( string source, string dest )

Makes a copy of the file source to dest. Returns TRUE on success or FALSE on failure.

Example 1. copy() example

<?php
$file
= 'example.txt';
$newfile = 'example.txt.bak';

if (!
copy($file, $newfile)) {
    echo
"failed to copy $file...\n";
}
?>

If you wish to move a file, use the rename() function.

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.

Note: Windows compatibility: If you copy a file with no size, copy() will return FALSE, but the file will be correctly copied.

See also move_uploaded_file(), rename(), and the section of the manual about handling file uploads.

Najlepsza ochrona mienia na rynku
tłumaczenia
opakowania z nadrukiem
Najlepsza organizacja eventów Gorąco Polecamy!

Another Useful functions:


zend.copy-constructor | zend-api.zend-hash-copy | zend-api.zend-copy-parameters-array | zend-api.zend-copy-ini-directives | streams.php-stream-copy-to-stream | streams.php-stream-copy-to-mem | opl.copyright | function.stream-copy-to-stream | function.runkit-method-copy | function.runkit-function-copy | function.pg-end-copy | function.pg-copy-to | function.pg-copy-from | function.oci-lob-copy | function.notes-copy-db | function.imap-mail-copy | function.imagepalettecopy | function.imagecopyresized | function.imagecopyresampled | function.imagecopymergegray | function.imagecopymerge | function.imagecopy | function.ifx-copy-blob | function.hwapi-copy | function.curl-copy-handle | function.copy | function.classkit-method-copy | copyright |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.