Posted by Alan Little on 05/22/06 13:38
Carved in mystic runes upon the very living rock, the last words of
Baron Samedi of comp.lang.php make plain:
> $text = '2==2';
>
> eval('$condition = ($text)? true : false;');
>
> if ($condtion)
> echo '<hr>True<hr>';
> else
> echo '<hr>False<hr>';
>
>
> -----------------------------------------------------------------------
> False
> -----------------------------------------------------------------------
1) Variables in single quotes do not get evaluated. That expression
needs to be in double quotes, and then you need to escape the $
for $condition
2) You have a typo. You have $condition in your eval, and $condtion
in your if().
--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
[Back to original message]
|