What is the structure of php?

Educative Answers Team

PHP is an embedded scripting language; this means that it is possible to write PHP code into an HTML file. Since web browsers can only process HTML files, the web-server converts and embeds the PHP code into one HTML file before sending it to the browser.

HTML tags

There are HTML tags for PHP code to indicate the start and end of PHP code in an HTML file. Any one of the following 4 tags can be used:

  1. php-code-here

The first and second tags are the ones most recommended and most widely used. Using a tag which is rarely used may result in a web-server being unable to detect the start and end of the PHP code.


Commenting

# and // are used to comment out a single line of code, while /* and */ indicate the start and end of a commented block of code.


Code

Chủ Đề