note 46485 deleted from function.include-once by tularis

From: Date: Wed, 13 Oct 2004 07:57:40 +0000
Subject: note 46485 deleted from function.include-once by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-78471@lists.php.net to get a copy of this message
Note Submitter: dkfj at 21cn dot com ---- a simple sample can see the difference between include and include_once: -----Included file (ss-1.php): <?php $ii = $i; ?> -----Main file (ss.php): <?php for ($i = 0; $i <= 4; $i++) { include_once "ss-1.php"; echo $ii; } ?> Here, you get "00000" as the result. And you will get "01234" when you change the above "include_once" to "include". So, remember don't use "include_once" in such a loop if you want to store some variables in a seperated file. ---- Reason: useless note

« previous php.notes (#78471) next »