php man page for stream_copy_to_stream

Query: stream_copy_to_stream

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

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
copyinstr(9r) - osf1
file_put_contents(3) - php
stream_copy_to_stream(3) - php
file_get_contents(3) - php
fwrite(3) - php
Similar Topics in the Unix Linux Community
echo with stdin
file transfer between two servers
script in Bash 2.05b.0(1) and 3.2.25(1) Red Hat
How to count number of occurances of string in a file?
Want to read data from a file name.txt and search it in another file and then matching...