Are you want to use the PHP code inside HTML code, if your answer is “YES”, then this tutorial is designed for you. Keep your close eye on this tutorial as Ima going to share how to use PHP code inside HTML by using the simple htacess code snippets.
Copy paste the below code into your htacess file and save it. It will allow you to write the PHP code inside HTML pages.
AddType application/x-httpd-php .htm .html
After adding the code, you can write your PHP code like below example:
Hello, today is <?=date('l, F jS, Y'); ?>.
Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies. View all posts by Prem Tiwari