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

ParameterIs RequiredDescription
fileRequired.Open file
bufferRequired.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);
}
?>




















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions