Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the exact Diff. between include_once() and
require_once() in PHP?

Answers were Sorted based on User's Feedback



What is the exact Diff. between include_once() and require_once() in PHP?..

Answer / 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

What is the exact Diff. between include_once() and require_once() in PHP?..

Answer / devendrarjadav

If the file specified with include_once() is not exist then
system displays warning where in the case of require_once()
system displays Fatal error in the client browsers window.

Is This Answer Correct ?    51 Yes 27 No

What is the exact Diff. between include_once() and require_once() in PHP?..

Answer / umapathi

include_once -it file is not exist it displays warning
message
in case of require_once-if the file is not exist it
displays fatal error

Is This Answer Correct ?    34 Yes 18 No

What is the exact Diff. between include_once() and require_once() in PHP?..

Answer / rahul anand

when we use require_once then if the file is not existed
then it will show the fetal error and will not execute the
instruction written under the require_once function. In the
case of include_once() if the file does not exist then it
will show the error message and also show the statements
written under the include_once function.

Is This Answer Correct ?    16 Yes 11 No

What is the exact Diff. between include_once() and require_once() in PHP?..

Answer / vineet kumar saini

1.include() includes a file in memory no matter if it has
already been loaded
2.include_once() includes a file in memory only if it has
not been loaded already
3.require() includes a file in memory no matter if it has
already been loaded. if the file cannot be loaded, the
script is aborted
4.require_once() does the same as require(), but only if the
file hasn't been included yet. if the file's already in
memory, it has no effect.

Is This Answer Correct ?    1 Yes 0 No

What is the exact Diff. between include_once() and require_once() in PHP?..

Answer / basha

include_once -it file is not exist it displays warning
message and continue the program

in case of require_once-if the file is not exist it
displays fatal error and terminate the prgram

Is This Answer Correct ?    21 Yes 21 No

What is the exact Diff. between include_once() and require_once() in PHP?..

Answer / senthil

in include_once display the warning message if the
containing file is not exist but require_once function
could not diplay the warning message it's a FATAL ERRor in
that time ...

Is This Answer Correct ?    4 Yes 4 No

What is the exact Diff. between include_once() and require_once() in PHP?..

Answer / izhar aazmi

Include => Include the said file during execution...
Require => Require the said file for the execution...

As in english "require" mandatory inclusion is expected and
hence, on failure execution shall halt with fatal error...

Is This Answer Correct ?    0 Yes 0 No

What is the exact Diff. between include_once() and require_once() in PHP?..

Answer / kedar haldikar

If the file specified with include_once() is not exist then
system displays warning where in the case of require_once()
system displays Fatal error in the client browsers window.

Is This Answer Correct ?    4 Yes 9 No

What is the exact Diff. between include_once() and require_once() in PHP?..

Answer / maish

both include external file accept

there is failer i smajor difference
in inclde give warning after failure and in requre
give fatal error stop execution file

Is This Answer Correct ?    6 Yes 13 No

Post New Answer

More PHP Interview Questions

How do you format and output a number with leading zero's?

3 Answers  


What are php libraries?

0 Answers  


How do you trim spaces in excel?

0 Answers  


How can I use single quotes in single quotes in php?

0 Answers  


What is the use of "ksort" in php?

0 Answers  


How to display your correct URL of the current web page?

0 Answers  


What does a special set of tags do in php?

0 Answers  


What is the scope of a variable defined in a function?

0 Answers  


How to reset/destroy a cookie?

0 Answers  


How does the identity operator ===compare two values in PHP?

0 Answers  


Which php framework is best for web development?

0 Answers  


Tell me what does accessing a class via :: means?

0 Answers  


Categories