Normally in php script we are using php components, connect with database and generate required output.
At that time our file extension is .php, but if we want to create .html file of .php file then we can use following code which reads complete output of .php file and make .html file of that output. But remember, that .php file is able to execute in browser.
<?php $output=file_get_contents('http://yourdomain.com/filename.php'); // Reads complete output of .php file $fp=fopen('filename.html','w+'); // Make .html file fputs($fp, $output); // Write output to .html file fclose($fp); // Close file pointer ?>
Hope this will help you….