How to declare variable in PHP
•Variables are capable to store information in them.In PHP all the variables begin with a dollar sign "$".It can store values like string,integer,boolean etc.
•There is no need to declare data type before adding a value to it.A variable is created at the same moment you provide it a value,there is no function or method to declare a variable
•When creating and declaring a variable certain rules are to be followed:
»Variable must start with letter or underscore(_).
»Variable with more than one word should be separated by underscore(_).
»PHP variables are case sensitive.
»It can have numeric(0-9), letter(a-z, A-Z) or underscore"_"
//Declaring variable in PHP
$str="WELCOME TO PHP PROGRAMMING!";
echo "<br>"."Value of a = ",$a;
echo "<br>"."Value of b = ",$b
echo "<br>"."Value of c = ",$c;
/*Output of the above program is:
WELCOME TO PHP PROGRAMMING!Value of a = 12Value of b = 8.2Value of c = 20.2