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


Please Help Members By Posting Answers For Below Questions

write a prog using insert,update,delete in this manner as output? name: phno. add button 1.name phno. edit button delete button 2.

1548


i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..

1668


What is $this in php?

531


What is the w3c?

8547


What is a trait in php?

565






What is csrf validation?

541


Does browser understand php?

482


Why is used in php?

519


What is curl php?

529


How to get ip address of a server in php?

541


how to track user logged out or not? when a user is idle?

525


How can you submit a form without a submit button?

527


Is a number php?

524


Define anonymous classes in php7?

555


What is meant by variable variables in php?

527