[snip]
Is it possible to return the result of eval function to a string rather than
outputting directly to the browser?
Thanks for your advice
[/snip]
Yes.
You're welcome.
The first freakin' example in TFM http://www.php.net/eval is this;
?php
$string = 'cup';
$name = 'coffee';
$str = 'This
Shaun
Shaun wrote:
Is it possible to return the result of eval function to a string rather than
outputting directly to the browser?
ob_start();
eval('$eval = evil;');
$output = ob_get_clean();
Cheers,
David Grant
--
David Grant
http://www.grant.org.uk/
--
PHP General Mailing List
Hi,
I want to evaluate the code in $php_code to *another* string...
you have to do it through output buffering:
ob_start();
eval($php_code);
$another_string=ob_get_contents();
ob_end_clean();
Rgds,
Tfr
--== [EMAIL PROTECTED] == http://tfr.cafe.ee/ == +372-50-17621 ==--
--
3 matches
Mail list logo