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 meaning of "enctype= multipart/form-data" ?
Is empty array php?
What is the timeout period on session values?
What exactly is PHP?
How to remove the new line character from the end of a text line?
What are the Formatting and Printing Strings available in PHP?
How to include a file to a PHP page?
Which is correct about mysqli and pdo?
How we can retrieve the data in the result set of mysql using php?
What does empty mean in php?
How many escape sequences are recognized in double-quoted strings in php?
How is session id stored in browser?
How to make database connection in php?
What is stripslashes php?
How to genrate report in wordpress cms