RE: [PHP] Eval To String
| From: | Jay Blanchard | Date: | Wed, 07 Dec 2005 16:00:53 +0000 |
| Subject: | RE: [PHP] Eval To String | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-227061@lists.php.net to get a copy of this message | ||
[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 is a $string with my $name in it.';
echo $str. "\n";
eval("\$str = \"$str\";");
echo $str. "\n";
?>