Re: Evaluating defines
| From: | Ernest E Vogelsinger | Date: | Wed, 04 Jun 2003 20:21:10 +0000 |
| Subject: | Re: Evaluating defines | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150256@lists.php.net to get a copy of this message | ||
At 13:46 04.06.2003, Yann Larrivee said:
--------------------[snip]--------------------
>My probleme is that i need to return the value of my define and not its
>name. My eval doesnt seem to work.
>
>Any body as a sugestion , or a better way to do this without passing by
>eval .
>
> $replace_by[] = eval("echo \$out[2][$i];");
--------------------[snip]--------------------
echo'ing the value wouldn't work here - you want the value part of your
defined name in a variable. You need this assignment within the eval:
eval('$replace_by[] = ' . $out[2][$i] . ';');
After this eval, the $replace_by array will contain the correct value.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/