Start · Sprachen · PHP · Referenz · copy

copy

Funktion

Kopiert eine Datei.

seit PHP 4.0.0 Kategorie: io

Signatur

copy(string $from, string $to, ?resource $context = null): bool

Beschreibung

Zielverzeichnis muss existieren. Für Streams: stream_copy_to_stream().

Parameter

Name Typ Default Beschreibung
$from Pflicht string Quelle.
$to Pflicht string Ziel.

Rückgabewert

Typ
bool

Beispiele

Basis

<?php

copy('template.conf', '/etc/app.conf');