Can someone body tell my what is the difference between false and true constant? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can someone body tell my what is the difference between false and true constant?

26th Dec 2015, 5:04 AM
Mohammed
8 Answers
+ 3
the last parameter in "define" says if it case sensitive or not. It means it's case sensitive for "false" (and this is the default, if you don't put this parameter) and if "true" its insensitive. example: <?php define ("MAX", 10, true); echo MAX; //output: 10 echo mAx; //output: 10 echo max; //output: 10
gt;
12th Mar 2016, 3:58 AM
Javad Noori
Javad Noori - avatar
+ 2
You should use "false" if you want your constant's name to be case sensitive over your code. For example, this code will generate and error: define("MSG", "Hi SoloLearners!",false); echo Msg; If you don't mind how you will recall the constant's name in your code in terms of case sentiviness, you can use "true" when you are defining your constant in the define function. For example, this code will not generate any error and will show "Hi SoloLearners!" three times (without the quotations marks) define("MSG", "Hi SoloLearners!",true); echo Msg; echo MSG; echo msg; By the way, "false" is the default value and if you omitted in the define function this is what you're going to get.
11th Jun 2016, 4:00 PM
Nelson Urbina
Nelson Urbina - avatar
+ 1
hi bro. true: case-sensetive is off. false:case-sensetive is on.
1st Jan 2016, 10:15 PM
mjansarizadeh
+ 1
true is on, and false is off
3rd Apr 2016, 8:34 PM
Andreas Heil
Andreas Heil - avatar
+ 1
True constant allows you to enter any format that you want to choose capital or small letter for value. Its by default false. When it's false u have to use the same name as a value in term of (capital or small) letter format
1st May 2016, 6:10 AM
Abhijeet Bhilare
Abhijeet Bhilare - avatar
+ 1
You can consider TRUE as 1 and FALSE as 0
27th Jun 2016, 5:01 PM
Varun Rajput
Varun Rajput - avatar
0
They are pre defined constants that could be used to check and assign a true or a false value of a variable. you will use it a lot.
4th Jan 2016, 10:02 PM
Ahmad Abu-Aysheh
Ahmad Abu-Aysheh - avatar
- 1
if you mean difference between case sensitivity. when this property is true then varx and varX are two different variables for php. when the property is false then you can type vary or varY there is no difference for php.
15th Feb 2016, 4:40 PM
Igor Kuzmenko
Igor Kuzmenko - avatar