Re: Re: require_once

From: Date: Thu, 02 Sep 2010 10:59:07 +0000
Subject: Re: Re: require_once
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-307823@lists.php.net to get a copy of this message
On 2 September 2010 12:55, Jangita <jangita@jangita.com> wrote: > On 01/09/2010 10:56 p, freeman3@centrum.cz wrote: >> >> I think the files included just when you call it to include. How do you >> mean >> it later? >> What's in that file? A class or direct code? >> >> David Mehler wrote: >> >>> Hello, >>> I've got probably a simple question on require_once. I've got a file >>> that has require_once at the top of it pulling in another file of >>> functions. Later on in this file I've got another require_once >>> bringing in a second file. In this second file I have a function call >>> to a function defined in the first files' top require_once functions >>> file. I'm getting a call to undefined function. >>> Should I change he require_once to require at the top of the first >>> file to fix? I thought require_once meant it was in that file and >>> anything pulled in later? >>> Thanks. >>> Dave. >> >> > > If i get you correctly > > file1.php has a require_once to file2.php > then file 1.php has a require_once to file3.php > but file3.php calls a function in file2.php > > answer would be to require_onec file2.php in file3.php Which wouldn't do anything seeing as file2.php has already been included by file1.php. Regards Peter -- <hype> WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind BeWelcome/Couchsurfing: Fake51 Twitter: http://twitter.com/kafe15 </hype>

« previous php.general (#307823) next »