PHP stream_copy_to stream() Funksie
Voorbeeld
Kopieer 1024 grepe data van een stroom na 'n ander:
<?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";
?>
Definisie en gebruik
Die stream_copy_to_stream() funksie kopieer data van een stroom na 'n ander.
Sintaksis
stream_copy_to_stream(src, dest, maxlength, offset)
Parameterwaardes
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 |
Tegniese besonderhede
Terugkeerwaarde: | Die totale aantal grepe gekopieer. ONWAAR op mislukking |
---|---|
PHP weergawe: | 5,0+ |
PHP Changelog: | PHP 5.1: Bygevoeg die offset parameter |
❮ PHP-stroomverwysing