How to insert PHP code into HTML?

To be able to use php code on a page with an extension other than .php, you need a server which supports .htaccess files.
To add an extension to be parsed for php, create or edit a file called .htaccess (with the dot first) containing the following line:

AddType application/x-httpd-php .phtml .pwml .php3 .php4 .php .php2 .inc .html

in .htaccess file,and it works fine.

This tells the server to check for php code and execute it in files with extensions phtml .pwml .php3 .php4 .php .php2 .inc .html