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
memmove(3) - centos
file_put_contents(3) - php
fseek(3) - php
stream_copy_to_stream(3) - php
copy(3) - php
Similar Topics in the Unix Linux Community
creating files and getting input from another file
file transfer between two servers
script in Bash 2.05b.0(1) and 3.2.25(1) Red Hat
Help with shell script: moving end of line character
if file is NOT empty, then append content to file