Greenhorn Greenhorn - 1 year ago 75
PHP Question

Converting a .php file to a .html file?

I have a .php file which has several queries in it. I want the output file as a .html file...

Is there any way to do this. I am currently doing this by saving, using my browser, that executed PHP file, as an .html file. But when I launch my product that should not be the case of the client.

Please suggest a way, thanks in advance...

Answer Source

Here is a sample code:



// your PHP / HTML code here

file_put_contents('where/to/save/generated.html', ob_get_clean());

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download