Re: include and require

From: Date: Sun, 02 Jul 2000 08:37:35 +0000
Subject: Re: include and require
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4374@lists.php.net to get a copy of this message
Eris - I have a site that has an auto_append / auto_prepend header and footer. To keep the header managable I have a require(sitefunctions.php) statment which allows me to keep all site wide functions out of the header file. Using require here makes sense since I always want the file, regardless of whatelse is going on. For specific pages I might include() additional functions but only if needed by the code. -- Scott On Sun, Jul 02, 2000 at 11:18:24PM +0700, Eris Ristemena wrote: > OK , thanks for the answer. > > The answer was just like in the manual but with neat illustration. :) > > If that's the case, shouldn't we always use include() rather than require() > ?? i mean (correct me if i'm wrong) you cann't use require() in else-if > statement or looping, and there's speed degradation if we use require(). So > why they still use this in PHP 4.0 ?? > > i think that's the question, is there any advantages or disadvantages of > require and include ?

« previous php.general (#4374) next »