PHP kopyala() İşlev
❮ PHP Dosya Sistemi ReferansıÖrnek
"source.txt" dosyasını "target.txt" dosyasına kopyalayın:
<?php
echo copy("source.txt","target.txt");
?>
Tanım ve Kullanım
copy() işlevi bir dosyayı kopyalar.
Not: to_file dosyası zaten varsa , üzerine yazılır.
Sözdizimi
copy(from_file, to_file, context)
Parametre Değerleri
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() |
Teknik detaylar
Geri dönüş değeri: | Başarıda DOĞRU, başarısızlıkta YANLIŞ |
---|---|
PHP Sürümü: | 4.0+ |
PHP Değişiklik Günlüğü: | PHP 5.3 - Bağlam parametresi eklendi |
❮ PHP Dosya Sistemi Referansı