PHP स्ट्रीम_कॉपी_टू स्ट्रीम () फ़ंक्शन
उदाहरण
एक स्ट्रीम से दूसरी स्ट्रीम में 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(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 |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | कॉपी किए गए बाइट्स की कुल संख्या। विफलता पर FALSE |
---|---|
पीएचपी संस्करण: | 5.0+ |
पीएचपी चेंजलॉग: | PHP 5.1: ऑफ़सेट पैरामीटर जोड़ा गया |
❮ पीएचपी स्ट्रीम संदर्भ