PHP& Code Snippets07 Apr 2005 03:33 pm
ob_start ob_end_clean - Get the OUTPUT of an already parsed file
To get the output of a parsed file (without printing to the screen):
<?
// Grab output of file
ob_start();
include(”parsed_file.php”);
$test_data = ob_get_contents();
ob_end_clean();
// Write to a new file if you like
if($fh = fopen(”new_file.html”, “w”)){
fputs($fh, $test_data);
fclose($fh);
}
?>