EOM; $chk = ob_get_clean(); $fp = fopen('test.html', "wb"); fwrite($fp, $chk); fclose($fp); ?>