What are the differences between require and include, include_once?

What are the differences between require and include, include_once?

What are the differences between require and include, include_once?

View Answers

November 13, 2010 at 4:44 PM

Hi,

requireonce() and includeonce() are both the functions to include and evaluate the specified file only once. If the specified file is included previous to the present call occurrence, it will not be done again.

But require() and include() will do it as many times they are asked to do.

It?s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.

Thanks









Related Tutorials/Questions & Answers:
What are the differences between require and include, include_once?
differences between require and include, include_once.
Advertisements
What’s the difference between include and require?
What are the differences between EJB and Spring
require() and include()
php include and require
Differences between HashMap and Hashtable?
What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?
Differences between session and cookie
differences between cell spacing and cell padding
difference between <%@ include ...> and <jsp:include>
differences between GET and POST methods in form submit
Differences between OLAPDataGrid and AdvancedDataGrid
differences
What is the difference between the >> and >>> operators?
RequestDispatcher object, difference between include( ) and forward( ) method.
Differences between the String, StringBuilder, and StringBuffer classes
What does core Java include?
what is the difference between extends and implements
what is the difference between extends and implements
What is the difference between PHP4 and PHP5?
What is difference between a PROCEDURE & FUNCTION ?
What is the difference between $message and $$message?
what is the Difference between weblogic and jboss?
what is the difference between pop and oop
What is the difference between hibernate and spring
What is the difference between a constructor and a method?
What is difference between the java and javascript?
What is the difference between a JDK and a JVM?
What is difference between Hibernate 4 and 5?
What is difference between Hibernate 4 and 5?
What is difference between Hibernate 4 and 5?
What is difference between Path and Classpath?
What is difference between TRUNCATE & DELETE
What is the difference between JPA and Hibernate?
What is difference between the java and javascript?
What is the difference between IN and BETWEEN, that are used inside a WHERE clause?
what is difreence between javabeans and enterprise beans - EJB
What is the difference between ereg_replace() and eregi_replace()?
What is the difference between the functions unlink and unset?
What are the difference between abstract class and interface?
what is the difference between distributed application and web application?
What’s the difference between load() and get()?
What is difference between singleton and prototype bean?
What is the difference between JSF, Servlet and JSP?
what is difference between objectan primitive? - Java Beginners
what is the difference between productList==null and productList.size()==0
What is the difference between the Boolean & operator and the && operator?
What are difference between Bean Factory and Application Context ?
what is the difference between the eclipse and myeclipse - IDE Questions

Ads