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 failed, it returns EOF.

Syntax

set_file_buffer(file,buffer)
Parameters Description
file Required. Specifies the opened file.
buffer Required. Specifies the buffer size in bytes.

Tips and Comments

Note:This function is an alias for 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);
  }>
?>