#23766 [Opn->Bgs]: include/require that return
ID: 23766
Updated by: rasmus@php.net
Reported By: ericn at ionws dot com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 4.3.1
New Comment:
ob_start()
include 'foo.php';
$foo = ob_get_contents();
ob_end_clean();
Previous Comments:
------------------------------------------------------------------------
[2003-05-22 20:39:23] ericn at ionws dot com
Currently (obviously), include(_once) and require(_once) process the
php file that they are called with and output of that file is sent.
However, it would be useful to store an included file's output in a
variable instead of sending it to the user. For example:
include.php:
<?php echo "<b>Bold Text</b>"; ?>
include("include.php");
would send <b>Bold Text</b> to the user, however, the hypothetical
function (or construct) includeto would store all of include.php's
output in a variable. So:
$output = includeto("include.php");
$output would contain "<b>Bold Text</b>"
If there is already a way to accomplish this, I apologise, but could
not find one.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23766&edit=1
Thread (2 messages)