PHP stream_copy_to stream() Fonksiyon
Örnek
1024 bayt veriyi bir akıştan diğerine kopyalayın:
<?php
$src = fopen("test1.txt", "r");
$dest = fopen("test2.txt", "w");
//
Copy 1024 bytes to test2.txt
echo stream_copy_to_stream($src, $dest, 1024)
. " bytes copied to test2.txt";
?>
Tanım ve Kullanım
stream_copy_to_stream() işlevi, verileri bir akıştan diğerine kopyalar.
Sözdizimi
stream_copy_to_stream(src, dest, maxlength, offset)
Parametre Değerleri
Parameter | Description |
---|---|
src | Required. Specifies the source stream to copy data from |
dest | Required. Specifies the destination stream to copy data to |
maxlength | Optional. Specifies the maximum bytes to copy |
offset | Optional. Specifies the offset where to start to copy data |
Teknik detaylar
Geri dönüş değeri: | Kopyalanan toplam bayt sayısı. Başarısızlıkta YANLIŞ |
---|---|
PHP Sürümü: | 5.0+ |
PHP Değişiklik Günlüğü: | PHP 5.1: Offset parametresi eklendi |
❮ PHP Akış Referansı