PHP Syntax

Any where we can use PHP script inside of the document.

The PHP script start  with <?php and ends with ?>

// PHP code goes here

The default file extension is .php  ( Eg. test.php )

Example :

To get a fell of PHP code, first we will start  with simple PHP script. Since “Hello, World!” is an essential example, first we will create a friendly little “Hello, World!” script.

<title>Hello World</title>
    <?php echo "Hello, World!";?>

It will produce the following output

Hello, World!

Note: PHP statements are terminated by semicolon ( ; )

Comments in PHP:

A  comment in PHP code is a line, that is not execute or read by program. Below we mentioned the different types of comments in PHP.

     // Single line comment
     # single line comment
        Multiple line comment

Case-insensitive in PHP:

In PHP, all user defined function, classes and keywords ( Eg: print, echo, foreach, while, etc., ) are case-insensitive.