Saturday, May 29, 2010

Sending PHP otput to a file

function ob_callback($buffer) {
global $ob_file;
fwrite($ob_file, $buffer);
}

$ob_file = fopen('test.txt','w');
ob_start("ob_callback");

/* Here goes content. */

ob_end_flush();

No comments:

Post a Comment