Pipe Output to HTML File

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jnhemley
Forum Newbie
Posts: 1
Joined: Thu Nov 13, 2008 5:40 pm

Pipe Output to HTML File

Post by jnhemley »

How can I redirect my output in PHP from a monitor to an html file such that I can bring up the file and display my page as if it would have been originally output to the monitor ?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Pipe Output to HTML File

Post by Eran »

Code: Select all

 
ob_start();
//Render page
$html = ob_get_clean();
file_put_contents('/path/to/page.html',$html);
 
Post Reply