What is the exact Diff. between include_once() and
require_once() in PHP?
Answer Posted / arvind pippal
. The include_once() statement includes and evaluates the
specified file during the execution of the script. This is
a behavior similar to the include() statement, with the
only difference being that if the code from a file has
already been included, it will not be included again. As
the name suggests, it will be included just once.
include_once() should be used in cases where the same file
might be included and evaluatedmore than once during a
particularexecution of a script, and you want to be sure
that it is included exactly once to avoid problems with
function redefinitions, variable value reassignments, etc.
require_once() should be used in cases where the same file
might be included and evaluatedmore than once during a
particular execution of a script, and you want to be sure
that it is included exactly once to avoid problems with
function redefinitions, variable value reassignments, etc.
| Is This Answer Correct ? | 50 Yes | 12 No |
Post New Answer View All Answers
What is the latest version of php?
How do I check if a given variable is empty?
Do you know design patterns. List few?
What is the use of count() function in php?
What are the methods useful for method overloading?
Is facebook still written in php?
How to select a database?
How do you define a constant in php?
Is python similar to php?
Explain about a search-friendly site looks like?
Is not null mysql?
What are the difference between echo and print?
How to write in a file in php?
How many columns can be added in a table in mysql?
Explain me what is the difference between explode() and split() functions?