How to declare Variable in PHP?

Hello,We Learn About How To Declare Variable In Php..

Following the simple Defination of Variable:

Variable:- Variable is a one type of name which store the value..

Follow the some rules to decler Variable is bellow..

* First,make a dollar($ sign) and after give the Variable.

* Variable name must start with latter or underscore.

* Variable name not contain any type of space.

* A Variable name must contain only alpha-numeric characters and underscores (A-z, 0-9, and _ )

* Every Variable are case sensitive. ($a and $A are two different variables).

I declare the Variable Like Bellow..

$demo=“Hello Friends!”;

$a=10;

Note:-In php The Dollar($ sign) is take autometically datatype depends on veriable value.

About the Author

avatar