|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-05-22 20:42 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Jun 16 05:00:02 2026 UTC |
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.