PHP set_file_buffer() function
Definition and Usage
The set_file_buffer() function sets the buffer size of the opened file.
If successful, the function returns 0. If failed, it returns EOF.
Syntax
set_file_buffer(file,buffer)
Parameter | Description |
---|---|
file | Required. Specifies the file to be opened. |
buffer | Required. Specifies the buffer size in bytes. |
Tips and Comments
Note:This function is an alias for stream_set_write_buffer().
Example
Create an unbuffered stream:
<?php $file = fopen("test.txt","w"); if ($file) { set_file_buffer($file,0); fwrite($file,"Hello World. Testing!"); fclose($file); } ?>