note 41457 deleted from function.include-once by nlopess

From: Date: Sun, 11 Apr 2004 11:22:44 +0000
Subject: note 41457 deleted from function.include-once by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-67973@lists.php.net to get a copy of this message
Note Submitter: Simon Hartley - srhartley@hotmail.com ---- 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.

« previous php.notes (#67973) next »