You are here: Re: I need a mini "logic interpreter" « PHP Programming Language « IT news, forums, messages
Re: I need a mini "logic interpreter"

Posted by Jerry Stuckle on 10/06/65 11:48

Rik wrote:
> Baron Samedi wrote:
>
>>1) oops, I didn't know that about the single quotes. Thanks.
>>
>>What did you mean by "escape the $ for $condition " ?
>
>
> In:
> eval("$condition = ($text)? true : false;");
>
> PHP will try to search for the variable "condition" to put in the eval
> statement.
>
> Escaping it like:
> eval("\$condition = ($text)? true : false;");
>
> will let PHP know it has to treat this part as text, so it will be evalled
> as "$condition" and not the value of the (prehaps existing) variable
> $condition. If it tries to replace it with the value of the variables
> "condition", there is off course no way $condition gets set in this
> statement.
>
> Grtz,

How about:

$condition = (eval ($text)) ? true : false;

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация