note 22150 added to function.ob-start
| From: | boris at gamate dot com | Date: | Sat, 08 Jun 2002 04:31:10 +0000 |
| Subject: | note 22150 added to function.ob-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31594@lists.php.net to get a copy of this message | ||
If you wish to have an object/method callback instead of [string output_callback] try this:
<?php
class foo {
function bar($buffer) {
return "<b>$buffer</b>";
}
}
$blah = new foo;
ob_start(array($blah,'bar'));
?>
Test!
<?php
ob_end_flush();
?>
I wondered why this feature is not documented ( or maybe I'm blind ).
--
http://www.php.net/manual/en/function.ob-start.php
http://master.php.net/manage/user-notes.php?action=edit+22150
http://master.php.net/manage/user-notes.php?action=delete+22150
http://master.php.net/manage/user-notes.php?action=reject+22150