|
> -----Original Message----- > From: web400-bounces@xxxxxxxxxxxx > [mailto:web400-bounces@xxxxxxxxxxxx]On > Behalf Of Scott Johnson > Sent: Tuesday, March 28, 2006 4:17 PM > To: Web Enabling the AS400 / iSeries > Subject: Re: [WEB400] include_path and php > > Newbie here: What are the pluses and minuses of include vs > require vs require_once. > > Use include() when the code to evaluate is optional, that way, if the file is not found, the script continues running and only generates a warning message. i.e.: help files. Use require() when the code to evaluate is mandatory for the successful running of the script. If the file is not found the script ends and generates an error message. i.e.: business function definitions. Both functions have the "_once" variation and are used if it is possible that the include() or require() functions can be parsed more the once and you don't want the secondary or tertiary evaluations to step on previously assigned variables. Beware of using these unnecessarily as they do slow down execution of the script. I've never been in a position where I have had to use either of these variations so can't give you a real world example but maybe the manual can help you out there: http://us3.php.net/manual/en/function.include-once.php Cheers, Don -- Ever had one of those days where you just felt like: http://cosmoslair.com/BadDay.html ?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.