PHP Variables | What is PHP Variable Type | Uses of PHP Variables

PHP Variables


PHP variables are characters that stores value or information such as text or integers in your code. In PHP variables are usually represented by a dollar sign ($).
Those variables can hold or stores a value. When we defining the variable, we are storing the value in memory a naming it.
  •  Syntax:

         

There are five basic rules for PHP variables:
  • A variable start with $ sign.
  • A variable must begin with a letter or underscore.
  • Variable name can have start only alpha-numeric and underscore (A-z and (_)).
  • Variable name is case-sensitive ($a and $A are two different variables).
  • When we declared variables spacing not allowed.

 

  • Creating variables: