PHP Variables Case Sensitive
A variable is the location where we stores the value or information according to the which data types it belongs to. While declaring the variable in PHP, we always keep in mind that PHP is case sensitive. You should always remember that in which case you define the variable at the time of declaring . For example :
$var_Cold = "December and January is the coldest month!"; $VAR_cold = "December is the coldest month of the year!";
The output is : December
and January is the coldest month!
December is the coldest month of the year!
In this example, we used two different variables $var_Cold and $VAR_cold both are different in their cases but the variable are same. Also, you can see the output is also different. Let see another example and you will understand in a better way:
$num = 15; $NUM = 20; $sum = $num + $NUM;
echo "num + NUM = ".$sum;
The output is :num + NUM = 35.
In the above example we used three variable of same data type. The first two variables are same but different in their cases and also assign with distinct values. The third variable $sum which is used to add the values of first two variables.
Let see one more example where we used two variables of same cases and the output will be the interesting one :
$num = 15; $num = 20; $sum = $num + $num;
echo "num + num = ".$sum;
The output is :
num + num = 40.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.