stream_copy_to_stream(3) php man page | unix.com

Man Page: stream_copy_to_stream

Operating Environment: php

Section: 3

STREAM_COPY_TO_STREAM(3)						 1						  STREAM_COPY_TO_STREAM(3)

stream_copy_to_stream - Copies data from one stream to another

SYNOPSIS
int stream_copy_to_stream (resource $source, resource $dest, [int $maxlength = -1], [int $offset])
DESCRIPTION
Makes a copy of up to $maxlength bytes of data from the current position (or from the $offset position, if specified) in $source to $dest. If $maxlength is not specified, all remaining content in $source will be copied.
PARAMETERS
o $source - The source stream o $dest - The destination stream o $maxlength - Maximum bytes to copy o $offset - The offset where to start to copy data
RETURN VALUES
Returns the total count of bytes copied.
CHANGELOG
+--------+------------------------------+ |Version | | | | | | | Description | | | | +--------+------------------------------+ | 5.1.0 | | | | | | | Added the $offset parameter | | | | +--------+------------------------------+
EXAMPLES
Example #1 A stream_copy_to_stream(3) example <?php $src = fopen('http://www.example.com', 'r'); $dest1 = fopen('first1k.txt', 'w'); $dest2 = fopen('remainder.txt', 'w'); echo stream_copy_to_stream($src, $dest1, 1024) . " bytes copied to first1k.txt "; echo stream_copy_to_stream($src, $dest2) . " bytes copied to remainder.txt "; ?>
SEE ALSO
copy(3). PHP Documentation Group STREAM_COPY_TO_STREAM(3)
Related Man Pages
memmove(3) - centos
fseek(3) - php
stream_get_contents(3) - php
file_get_contents(3) - php
copy(3) - php
Similar Topics in the Unix Linux Community
Replacing string
script in Bash 2.05b.0(1) and 3.2.25(1) Red Hat
if file is NOT empty, then append content to file
Want to read data from a file name.txt and search it in another file and then matching...
Shell Scripting