May 21, 2003 #1 770 Programmer Joined May 21, 2003 Messages 2 Location US My script reads: define ("WEEK", $week); if (defined(WEEK)){ echo "week IS defined."; } I never get to the echo; Why is my define failing?
My script reads: define ("WEEK", $week); if (defined(WEEK)){ echo "week IS defined."; } I never get to the echo; Why is my define failing?
May 21, 2003 #2 sej0924 IS-IT--Management Joined Apr 3, 2003 Messages 23 Location US The argument of defined() must be quoted: Code: define ("WEEK", $week); if (defined("WEEK")){ echo "week IS defined."; } try that... cheers Upvote 0 Downvote
The argument of defined() must be quoted: Code: define ("WEEK", $week); if (defined("WEEK")){ echo "week IS defined."; } try that... cheers
May 22, 2003 #3 DRJ478 IS-IT--Management Joined Aug 10, 2001 Messages 2,264 Location US The use of a defined constant allows you to just type the constant name in the code: Code: define("MYCONSTANT",'whatever'); echo(MYCONSTANT); Upvote 0 Downvote
The use of a defined constant allows you to just type the constant name in the code: Code: define("MYCONSTANT",'whatever'); echo(MYCONSTANT);