Home  >  Article  >  Backend Development  >  Why can't html see php code?

Why can't html see php code?

藏色散人
藏色散人Original
2021-06-24 09:05:172266browse

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.

Why can't html see php code?

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!

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