On Friday, March 29, 2002, at 11:39 PM, Jonathan Duncan wrote:
> I have read the page for eval on php.net
> several times as well as the very helpful examples, but whenever I use
> it just prints out the same stuff. By same stuff I mean wether I use
> or just the variable by itself it just prints out the contents of the
> variable. In the web page source it looks as if the contents were
> echoed because it still has the $'s and variable names. Any other
> ideas or
> examples on how to implement eval on this?
eval() can let your variable contain PHP code in addition to simple text
or HTML. That's what makes it different from just "echoing back the
text". So you could do
$print_statement = "print('test');";
// the output is "test", not "print('test');"
I just learned this function myself.
Web Developer Temp
Media Lab, H.H. Brown
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php