note 23705 added to function.ob-start
| From: | ben@php.net | Date: | Thu, 25 Jul 2002 14:18:54 +0000 |
| Subject: | note 23705 added to function.ob-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33548@lists.php.net to get a copy of this message | ||
Setting the ob_start callback to point to a method of an object (described above) will work, but the
object should be passed by reference not by value.
This may also explain why some people have had trouble doing this with some more complex objects.
<?php
class foo {
function bar($buffer) {
return "<b>$buffer</b>";
}
}
$blah = new foo;
ob_start(array(&$blah, 'bar'));
?>
Test!
<?php
ob_end_flush();
?>
--
http://www.php.net/manual/en/function.ob-start.php
http://master.php.net/manage/user-notes.php?action=edit+23705
http://master.php.net/manage/user-notes.php?action=delete+23705
http://master.php.net/manage/user-notes.php?action=reject+23705