PHP copy() Functie
❮ Referentie voor PHP-bestandssysteemVoorbeeld
Kopieer "source.txt" naar "target.txt":
<?php
echo copy("source.txt","target.txt");
?>
Definitie en gebruik
De functie copy() kopieert een bestand.
Opmerking: als het bestand to_file al bestaat, wordt het overschreven.
Syntaxis
copy(from_file, to_file, context)
Parameterwaarden
Parameter | Description |
---|---|
from_file | Required. Specifies the path to the file to copy from |
to_file | Required. Specifies the path to the file to copy to |
context | Optional. Specifies a context resource created with stream_context_create() |
Technische details
Winstwaarde: | WAAR bij succes, ONWAAR bij mislukking |
---|---|
PHP-versie: | 4.0+ |
PHP-wijzigingslogboek: | PHP 5.3 - Toegevoegde contextparameter |
❮ Referentie voor PHP-bestandssysteem