Is it not must to put double quotes for constant value declaration? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is it not must to put double quotes for constant value declaration?

b'coz question is given as<?phpdefine("AGE",28)?>is this correct???.....

20th Jul 2016, 7:28 AM
jason
7 Answers
+ 1
When it's an integer, quotes are not necessary. // These are acceptable: define("AGE", 28); define("AGE", "28"); However, quotes are needed for string values. // This will throw an error: define("AGE", Twenty Eight); // This is acceptable: define("AGE", "Twenty Eight");
29th Jul 2016, 3:47 PM
Dana Chia
0
Yes its correct you can now do as example: echo AGE; //note no $ variable sign
20th Jul 2016, 8:21 AM
GlennV
0
thank u glenn
20th Jul 2016, 9:14 AM
jason
0
ok
28th Jul 2016, 8:52 PM
Ivan Za
Ivan Za - avatar
0
thanx day....
29th Jul 2016, 4:21 PM
jason
0
👍
25th Jan 2017, 4:42 AM
jason
- 1
dude u should put value as double quotes as define("AGE","25");
6th Aug 2016, 3:18 PM
Praveen Kumar P
Praveen Kumar P - avatar