I was replying to this:
Printing to a file:
( http://www.phpbuilder.com/forum/archives/1/2001/1/2/108337)
//Turn output buffering on at the
//start of your page
ob_start();
?>
..etc
all the html you want
print "Nothing is sent to the browser until I flush the internal buffer";
// Write the contents of the buffer to results.html
// using ob_get_contents()
$newFile = @fopen("result.html", "w+");
if($newFile) {
fwrite( $newFile, ob_get_contents() );
} else [
//The file couldn't be opened for writing
}
//Now you can output everything to the broswer
ob_end_flush();
?>