Write PHP Code in HTML files
If you have ever come across the scenario in which you have to automate a website in which all the file are having an extension of .html and you have to write PHP code in Html files and you have to change all the file name extensions from .html to .php , After doing this you have to change all the Internal Links of the website too.
The solutions works fine but takes ample amount of time . In some cases it may take hours to do so.
What if I say it can be done in about 20 to 30 seconds and with very less amount of code. COOL RIGHT !!
This is what we are going to do here today and will run PHP Code in Html file or any other desired extension!
So this miracle can be done in two ways .
- The first can be done by working on Configuration of Your Server. (The hard and Delicate one).
- The Second can be done by using .htaccess file. (The easy and Cool one).