Home > Article > Backend Development > Why can't html see php code?
html cannot see the php code because all PHP code is executed on the server before the website is sent to the browser, and everything the browser receives is the result of PHP embedded in the HTML.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
Why can’t I see the php code in html?
Why can't I see my PHP code when viewing the source code?
Web developers and others who know about web pages know that you can use a browser to view a website's HTML source code. However, if the website contains PHP code, the code is not visible because all PHP code is executed on the server before the website is sent to the browser. Everything the browser receives is the result of PHP embedded in HTML. For the same reason, you can't go to a .php file on the web, save it and expect to see how it works. You only save the page generated by PHP, not PHP itself. PHP is a server-side programming language
PHP is a server-side programming language, which means that it is executed on the web server before the website is sent to the end user. This is why you can't see the PHP code when viewing the source code.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of Why can't html see php code?. For more information, please follow other related articles on the PHP Chinese website!