Re: Where to put the include()

From: Date: Wed, 07 Feb 2001 18:34:47 +0000
Subject: Re: Where to put the include()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38608@lists.php.net to get a copy of this message
----- Original Message ----- From: "Remi Ricard" <rricard@crim.ca> > Hi, > > I want to know why in the second file I don't get > a=134 as expected. <snip> > // file that don't work as expected > // print a= > <?PHP > function f2() > { > include ('./fileToBeIncluded.php'); > f1(); > } > echo "<html>"; > f2(); > echo "</html>"; > ?> Hi, Functions are separate blocks of code from the rest of the file. If you declare a function or variable inside a function (as you do here, since you include the file which contains a function inside the function) it will not be available to the rest of the script. I think. :-) Anna

« previous php.general (#38608) next »