note 41457 added to function.include-once
| From: | SimonHartley-srhartley at hotmail dot com | Date: | Sat, 10 Apr 2004 21:23:41 +0000 |
| Subject: | note 41457 added to function.include-once | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67966@lists.php.net to get a copy of this message | ||
The manual mentions PEAR as a source of include_once() examples although I couldn't find them
after searching their site.
I have provided a simple example.
// include.php --the file which will be included
<?php
echo 'The loop was activated <br />';
?>
//testinclude_once.php
<?php
$x = 1;
while ($x<4){
include_once('include.php');
$x++;
}
?>
Providing include.php is in the same directory, when testinclude_once.php is run, include.php is
called once.
Changing include_once to include, causes the output from include.php to be called throughout the
duration of the loop.
----
Manual Page -- http://www.php.net/manual/en/function.include-once.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41457
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41457&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41457&report=yes
Search -- http://master.php.net/manage/user-notes.php