PHP Write Echo content to file
You can get the echo content to variable as fallows
Write the echo content to file can achieve as fallows
ob_start(); echo '<html>'; echo '<div>';
echo 'TEST PRINT';echo '</div>'; echo '</html>'; $content = ob_get_clean();
$fp = fopen($_SERVER['DOCUMENT_ROOT'] . "/test. html","wb"); fwrite($fp,$content); fclose($fp);
Comments
Post a Comment