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