May 21, 2003 #1 770 Programmer May 21, 2003 2 0 0 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 Apr 3, 2003 23 0 0 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 Aug 10, 2001 2,264 0 0 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);