Category: PHP

A variable is used to store information and it is accessible later in the program.

It has the user-defined name.

In PHP you don’t need to specify the Datatype of a variable it automatically converts its type.

In PHP there are different types of variable are available –

  1. Local variable
  2. Global variable
  3. Static variable

How to Create a variable in PHP


Comment is a line of text which is not read and executed as part of the program.

It is used to add notes to the source code or stop some block of code from execution.

When writing a long script it is very helpful by adding comments on each step about what the code does.

If some other using your code or updating then it is easier for the user to understand the working of code and saves the time.

In PHP there are two types of comments¬† –

  1. Single line
  2. Multi-line

How to Add Comment in PHP