Home  >  Article  >  Backend Development  >  How to use PHP in pure HTML

How to use PHP in pure HTML

WBOY
WBOYOriginal
2016-08-04 09:21:431230browse

Generally, PHP is uninstalled from the .php file. Sometimes, when the PHP code is placed in .html, it is not parsed. How can the PHP code in the *.html file be parsed?

Reply content:

Generally, PHP is uninstalled from the .php file. Sometimes, when the PHP code is placed in .html, it is not parsed. How can the PHP code in the *.html file be parsed?

You can set files with .html suffix in the server to also be parsed by php

It is not recommended to do this, and basically no one does it.

If you insist on implementing it this way, then force it to be set in the Web Server so that when accessing .html files, they will be parsed by the PHP parser.

In addition to the above, Smarty specializes in template separation.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn