دالة PHP stream_copy_to stream ()
مثال
نسخ 1024 بايت من البيانات من دفق إلى آخر:
<?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";
?>
التعريف والاستخدام
تقوم الوظيفة stream_copy_to_stream () بنسخ البيانات من تدفق إلى آخر.
بناء الجملة
stream_copy_to_stream(src, dest, maxlength, offset)
قيمه المعامل
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 |
تفاصيل تقنية
قيمة الإرجاع: | العدد الإجمالي للبايت المنسوخ. خطأ في الفشل |
---|---|
إصدار PHP: | 5.0+ |
سجل التغيير في PHP: | PHP 5.1: تمت إضافة معامل الإزاحة |
❮ مرجع دفق PHP