Save the above program in a file named test.php in htdocs , then open the browser and type the address http:/// localhost: 8080 / test.php will result:
If you check the HTML output of the example above, notice that PHP code is not present in the file sent from the Server to your web browser. All PHP content present in the site is processed from that page; The only thing returned to the Client from the Web Server is the pure HTML output.
All PHP code must be contained within one of the 3 special markup tags identified by PHP Parser.
The most popular card is and we will also use the same tag in this series.
For static sites or HTML websites when a user requests to view a website, the request will be sent to the server. The server here simply sends the website content that the user wants to see about the browser to the user.
For PHP pages when requesting to view the website, the Server will proceed to generate that web page from PHP source code to HTML source code, then transfer that source code to the web browser for users to see. Because web browsers cannot read PHP source code, they can only read HTML source code.
In the next chapter we will discuss installing the PHP environment on the computer and then discuss the basic concepts related to PHP.
Follow tutorialspoint
Previous article: Variable in PHP
Next article: Constants in PHP