Which of the following functions will you use to change the number of bytes to buffer?
stream_set_write_buffer()
Correct:
stream_set_write_buffer()
Explanation:
Answer options D is correct.
The stream_set_write_buffer() function is used to set write file buffering on the given stream. The following example is setting 1024 bytes for the buffer:
<?php
$fp = fopen($file, "w");
if ($fp) {
stream_set_write_buffer($fp, 1024); //sets the buffer size to 1024 bytes
fclose($fp);
}
?>
Answer option A is incorrect. The ob_start() function is used to turn output buffering on. If output buffering is active, you cannot send any output from the script (other than headers). The output is stored in an internal buffer at that time.
Answer options B and C are incorrect. These are not the valid functions.