Date: 12/15/00
- Next message: roman <email protected>: "[PHP-DEV] PHP 4.0 Bug #8283: Impossible to connect to socket made by other unix daemon..."
- Previous message: waldschrott <email protected>: "[PHP-DEV] PHP 4.0 Bug #8281 Updated: still problem with for()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: cnewbill <email protected>
Operating system: Linux
PHP version: 4.0.3pl1
PHP Bug Type: Feature/Change Request
Bug description: Is there a function for this?
I guess this is more of a hack than anything, but I really needed eval()'s code NOT to be displayed right away. So I used ob_start(), ob_get_contents(), and ob_end_clean().
<?php
$stuff = "Hello, ";
ob_start(); // start buffer
eval("print 'World!';"); // execute code
$retval = ob_get_contents(); // return executed code
ob_end_clean(); // delete the buffer
print $stuff.$retval;
?>
This would print "Hello, World!" instead of "World!Hello, ".
Is there a function to do this already?
Thanks,
Chris
-- Edit Bug report at: http://bugs.php.net/?id=8282&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: roman <email protected>: "[PHP-DEV] PHP 4.0 Bug #8283: Impossible to connect to socket made by other unix daemon..."
- Previous message: waldschrott <email protected>: "[PHP-DEV] PHP 4.0 Bug #8281 Updated: still problem with for()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

