How to convert php file to html?

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.

$output=file_get_contents(''); // 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….

Posted in PHP. 1 Comment »

One Response to “How to convert php file to html?”

  1. anita Says:

    in my side vedio start the offline and not satrt online so.please reply now

Speak Your Mind

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: