note 82775 added to function.define
| From: | jason at sitehatcherydotcom | Date: | Fri, 25 Apr 2008 06:28:06 +0000 |
| Subject: | note 82775 added to function.define | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138763@lists.php.net to get a copy of this message | ||
You can store your constant as the value of a variable like this:
$variable=VARIABLE;
To access the constant, do this: constant($variable).
Beware: if your variable changes, then you loose your reference to the constant - but the constant
itself will not change.
I've found this especially useful for storing the constant string (i.e. VARIABLE) in a
database.
----
Server IP: 209.41.74.194
Probable Submitter: 70.136.41.87
----
Manual Page -- http://www.php.net/manual/en/function.define.php
Edit -- https://master.php.net/note/edit/82775
Del: integrated -- https://master.php.net/note/delete/82775/integrated
Del: useless -- https://master.php.net/note/delete/82775/useless
Del: bad code -- https://master.php.net/note/delete/82775/bad+code
Del: spam -- https://master.php.net/note/delete/82775/spam
Del: non-english -- https://master.php.net/note/delete/82775/non-english
Del: in docs -- https://master.php.net/note/delete/82775/in+docs
Del: other reasons-- https://master.php.net/note/delete/82775
Reject -- https://master.php.net/note/reject/82775
Search -- https://master.php.net/manage/user-notes.php