PHP Syntax


Basic Syntax

This tutorial will give you an outline of the very basic syntax of PHP and very important to make your PHP basics knowledge strong.

 

 Standard or Canonical tags start with <?php and ends with ?>.

 

Standard or Canonical tags

 

 Short open tags start  with <?= and end with ?>. This is the shortcut of the standard tag.

 

Short open tags

 

We can write PHP within HTML as follows:

 

php within html

 

Single Line Comment can be explored as -

 

single line comment

 

Output :

php output

 

Multi-line or Multiple line Comment can be written as -  

 

multiple line comments

 

Output:

 

php output