Re: problem with eval()
| From: | Alan Gillespie | Date: | Fri, 14 Jul 2000 05:01:30 +0000 |
| Subject: | Re: problem with eval() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6597@lists.php.net to get a copy of this message | ||
'fraid these suggestions don't work either.
maybe I'm expecting PHP to do too much other than the
simple replacement of values in Strings.
I accept that if I declare variables
$value = 1 and
$today = 1
in my 'application' then parse the Src_File it
substitutes the values of $value & $today for their
numeric value, but I thought I should still be able to
evaluate/process the statement, and if there is any
result/output, pass this back to the string you've
assigned ($new_string)
very puzzled & confused,
alan
> >
> > You probably want something along the lines of:
> >
> > $complete_code = '($value == $today) ? "Hello
World" : ""';
> >
> > and then
> >
> > eval("\$new_string = \"$complete_code\";);
>
> Actually, get rid of the \"'s there.
>
> -Rasmus
>