How to write php script in index.html?

how to write php script in index.html

Example: If we write <?php echo “Hello”;?> in index.php the output is “Hello”, if we write <?php echo “Hello”;?> in index.html what will be the out put?

and is it possible to execute the php script in extension of html (ie. index.html)

Web Development Services

Hi, you can tell your server to treat a html file as a php file in the .htaccess file.

Add this to your site’s .htaccess file

AddType application/x-httpd-php .html .htm

Try your echo statement again in the index.html file to check it’s working.

More info here: http://www.besthostratings.com/articles/php-in-html-files.html