note 21280 added to function.ob-start

From: Date: Mon, 06 May 2002 13:44:16 +0000
Subject: note 21280 added to function.ob-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-30262@lists.php.net to get a copy of this message
It is impossible to call ob_start() from an ob_handler; however, if you only need one level of nesting, this might do the trick: <?php function footer( $str ) { ob_start(); include( "footer.php" ); $contents = ob_get_contents(); ob_end_clean(); return $str.$contents; } ob_start(); ?> html bla bla <?php $content = ob_get_contents(); ob_end_clean(); print footer( $content ); ?> -- http://www.php.net/manual/en/function.ob-start.php http://master.php.net/manage/user-notes.php?action=edit+21280 http://master.php.net/manage/user-notes.php?action=delete+21280 http://master.php.net/manage/user-notes.php?action=reject+21280

« previous php.notes (#30262) next »