From 2a432a960eaf53a876af7708b79892f77db08450 Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Tue, 5 Apr 2005 22:04:02 +0000 Subject: [PATCH] include(): Show how to "include a file into a variable", and see also the auto_(prepend|append)_file directives. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@183691 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/control-structures.xml | 39 ++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/language/control-structures.xml b/language/control-structures.xml index d65e794c48..eca7d85eae 100644 --- a/language/control-structures.xml +++ b/language/control-structures.xml @@ -1,5 +1,5 @@ - + Control Structures @@ -1549,11 +1549,40 @@ echo $bar; // prints 1 the included file. - A few other ways to "include" files into variables are with - fopen, file or by using - include along with - Output Control Functions. + Another way to "include" a PHP file into a variable is to capture the + output by using the Output Control + Functions with include. For example: + + + Using output buffering to include a PHP file into a string + + +]]> + + + + + In order to automatically include files within scripts, see also the + auto_prepend_file and + auto_append_file + configuration options in &php.ini;. + ¬e.language-construct;