ob_clean in php

ob_clean — Clean (erase) the output buffer

Description of ob_clean in php

ob_clean(): bool

This function discards the contents of the output buffer.

Example ob_clean

<?php

// require some external library files
require ("lib/somelibrary.php");
require ("lib/class/someclass.php");

// clean the output buffer
ob_clean();

// simple test image
header("Content-type: image/gif");
$im = imagecreate (100, 50);
imagegif($im);
imagedestroy($im);

?>

Leave a Comment