Re[PHP] Dynamic constant names -SOLVED
| From: | Geoff Caplan | Date: | Tue, 27 Mar 2001 14:11:45 +0000 |
| Subject: | Re[PHP] Dynamic constant names -SOLVED | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45726@lists.php.net to get a copy of this message | ||
Hi folks
I had 2 suggestions from the list:
1) indirection - $constant_value = $$constant_name ;
I had already tried this, but couldn't get it to work. Unless I am
missing something it just gives an "Undefined Variable" error.
2) eval("\$constant_value = $constant_name;") ;
This does work. Thanks Paul!
Geoff Caplan