note 11766 deleted from function.define by sniper

From: Date: Wed, 29 Jan 2003 03:47:27 +0000
Subject: note 11766 deleted from function.define by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-42962@lists.php.net to get a copy of this message
[Editor's note: see the (still undocumented) constant() function, from the source code: mixed constant(string const_name) Given the name of a constant this function will return the constants associated value It will be properly documented soon] 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.

« previous php.notes (#42962) next »