stream_set_write_buffer
stream_set_write_buffer
Sets write file buffering on the given stream
int **stream_set_write_buffer** resource $stream int $size
Sets the buffering for write operations on the given
to bytes.
stream``size
streamThe file pointer.
size
The number of bytes to buffer. If
is 0 then write operations are unbuffered. This ensures that all writes
with are completed before other processes are
allowed to write to that output stream.
size``fwrite
Returns 0 on success, or another value if the request cannot be honored.
Voorbeeld: example
The following example demonstrates how to use
to create an unbuffered stream.
`stream_set_write_buffer`
<?php
$fp = fopen($file, "w");
if ($fp) {
if (stream_set_write_buffer($fp, 0) !== 0) {
// changing the buffering failed
}
fwrite($fp, $output);
fclose($fp);
}
?>
fopen``fwrite