PHP set_file_buffer() Function
Definition
The set_file_buffer() function sets the buffer size of an open file.
This function is an alias of stream_set_write_buffer().
Syntax
PHP set_file_buffer() Function has the following syntax.
set_file_buffer(file,buffer)
Parameter
Parameter | Is Required | Description |
---|---|---|
file | Required. | Open file |
buffer | Required. | Buffer size in bytes |
Return
This function returns 0 on success, otherwise it returns EOF.
Example
Create an unbuffered stream:
<?php/*ww w .java2 s. c o m*/
$file = fopen("test.txt","w");
if ($file){
set_file_buffer($file,0);
fwrite($file,"Hello World. Testing!");
fclose($file);
}
?>