Re: Re-engineering print() - PHP 4 required
| From: | Kristofer Widholm | Date: | Thu, 11 Jan 2001 07:26:24 +0000 |
| Subject: | Re: Re-engineering print() - PHP 4 required | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-33918@lists.php.net to get a copy of this message | ||
Here's what you wrote, 01-01-10:
Try this: function my_eval($code) { ob_start(); eval($code); $retval = ob_get_contents(); ob_end_clean(); return $retval; } $str = my_eval("echo 2+2;"); echo $str;Mr. Lerdorf, Mr. McClahahan, Mr. Butzon et al, Thank you for your replies. It appears I'm going to have to see about having my server upgraded to PHP 4 in order to solve the problem, as PHP 3 does not support ob_*(). If anyone else is paying attention to this thread, please be advised that ob_ functions require PHP 4. Thanks to all who have helped. Sincerely, Kristofer -- http://www.brokenhill.net ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/~~~~~~~~~~~~~~~~~~~~~~~~ "The only real ideas are the ideas of the shipwrecked" --Ortega y Gassett ~~~~~~~~~~~~~~~~~~~/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~