Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,153,237 members, 7,818,793 topics. Date: Monday, 06 May 2024 at 03:50 AM |
Nairaland Forum / Science/Technology / Webmasters / What's The Difference Between "require Once" And "include" In Php? (6825 Views)
7 Reasons Why You Must Include Images In Blog Posts By Mediapace / What’s The Difference Between A Mobile Website And Responsive Web Design? / What Is The Difference Between A Web Designer And A Web Developer? (2) (3) (4)
What's The Difference Between "require Once" And "include" In Php? by cmon(m): 12:39pm On Sep 18, 2007 |
Please I'ld like solutions to the above topic |
Re: What's The Difference Between "require Once" And "include" In Php? by my2cents(m): 2:00pm On Sep 18, 2007 |
include() - http://us2.php.net/manual/en/function.include.php require_once() - http://us2.php.net/require_once for all future PHP reference: http://us2.php.net/ |
Re: What's The Difference Between "require Once" And "include" In Php? by kazey(m): 2:18pm On Sep 18, 2007 |
Dont get confuse with the _once attribute. The function is basically include() and require(). the _once attribute can be added to both. And Both actually do the same thing in regards to adding the specified file, but are different in the way they handle failures. _once is included in the respective functions to avoid problem with function redefinitions. That is preventing the file been included for evaluation or execution from been added more than once. The difference between include() and require is simply, when the specified file is called in both cases , and the file does not exist for example, the require() function returns a fatal error while the include() function, returns a warning, which means the scripts calling the function does not halt, as in the case of with the require(). so its basically, the include() function in a script would show a warning if the specified file does not exist and the require(), function would return an error and halt if the file been called for evaluation or execution does not exist for example. The require makes the file inclusion compulsory , while the include can continue with the other part of the calling script if applicable, if that specified file in the function does not exist. Looking for a host for your PHP Websites try Nairahost at Nairahost Nigeria |
Re: What's The Difference Between "require Once" And "include" In Php? by cmon(m): 11:17pm On Sep 22, 2007 |
Thanks for your contributions. @kazey, Thanks particularly. You don't need to tell me about Nairahost cos I already have a couple of sites hosted with you guys. Keep up the good work. You've been impressive. So far. |
(1) (Reply)
12 Seo Mistakes To Avoid If You Want To Rank Higher / The Best Nigerian University Website / Can I Start A Car Blog In Nigeria?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13 |