note 54926 deleted from function.include by peehaa
| From: | peehaa@php.net | Date: | Fri, 09 Dec 2016 22:47:11 +0000 |
| Subject: | note 54926 deleted from function.include by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208384@lists.php.net to get a copy of this message | ||
Note Submitter: ignacio esviza
----
Hi, there...
I've use this in order to grab the output from an include() but without sending it to the
buffer.
Headers are not sent neither.
<?php
function include2($file){
$buffer = ob_get_contents();
include $file;
$output = substr(ob_get_contents(),strlen($buffer));
ob_end_clean();
ob_start();
echo $buffer;
return $output;
}
?>