Re: include and require

From: Date: Sun, 02 Jul 2000 08:49:25 +0000
Subject: Re: include and require
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4378@lists.php.net to get a copy of this message
Because require() ensure that my sitefunctions.php file ALWAYS get included as part of the standard header vs the include() statment which may not ever get evaluated by the code. If the include() doesn't get parsed then sitefunctions.php never get's included in the main header and other scripts would fail. require() avoids that problem. -- Scott On Mon, Jul 03, 2000 at 12:42:19AM +0700, Eris Ristemena wrote: > well, you can use include() rather than require() right ? why you use > require() ? > > -----Original Message----- > From: scottrus@ipass.net <scottrus@ipass.net> > To: Eris Ristemena <ste94034@stttelkom.ac.id> > Cc: php-general@lists.php.net <php-general@lists.php.net> > Date: Monday, July 03, 2000 12:31 AM > Subject: Re: [PHP] include and require > > > >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 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Scott

« previous php.general (#4378) next »