note 11766 added to define
| From: | j dot kase at privador dot com | Date: | Tue, 06 Mar 2001 12:58:00 +0000 |
| Subject: | note 11766 added to define | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11933@lists.php.net to get a copy of this message | ||
I am also looking for a way to use constant whose name is stored in another variable, like:
define("MYCONST_1","something");
define("MYCONST_2","something_else");
for ($loop = 1; $loop < 3; $loop++) {
${"my_other_var_".$loop} = "MYCONST_".$loop;
}
A quick and not-so-pretty way of doing this is just to change constants to regular variables, but
this kinda defeats their original purpose, so a solution would be handy here.
http://www.php.net/manual/en/function.define.php