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
Is php easier than node?
How does php strcmp work?
What is the interface in php?
Explain the installation of PHP on UNIX systems?
How to get the IP address of the client/user in PHP?
Explain do you use composer? If yes, what benefits have you found in it?
What is difference between ksort() and usort() functions.
How do you destroy a session?
What is preg_match?
Is salary a ratio or interval?
Who is the father of php and what is the current version of php and mysql?
Suppose we receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would we validate whether the field is empty? Print a message "the email cannot be empty" in this case?
How to store the uploaded file to the final location?
Hello Friends,I am seeking for a job in php having 9 months. exp.Please suggest any company openings.
What is the name of scripting engine in php?