Whats the difference between include() and require()?

Answers were Sorted based on User's Feedback



Whats the difference between include() and require()?..

Answer / kathiresan n

You can insert the content of a file into a PHP file before
the server executes it, with the include() or require()
function.
The two functions are identical in every way, except how
they handle errors.
The include() function generates a warning but the script
will continue execution while the require() function
generates a fatal error and the script execution will stop
after the error.

Is This Answer Correct ?    9 Yes 0 No

Whats the difference between include() and require()?..

Answer / mahidhar

include() produces a Warning message where as require()
gives Fatal Error.

Is This Answer Correct ?    8 Yes 3 No

Whats the difference between include() and require()?..

Answer / priyanka

include() function generates a warning but the script
will continue execution while the require() function
generates a fatal error and the script execution will stop
after the error.

Is This Answer Correct ?    1 Yes 0 No

Whats the difference between include() and require()?..

Answer / shanawar

Both used for connecting to the database. but the main
difference b/w them if we r using include()and the file is
not found then a warring will be occure and script will be
execute.. But in the case of require() a error will occure
and script will be helt........................ Shanawar

Is This Answer Correct ?    1 Yes 12 No

Post New Answer

More PHP Interview Questions

What are the main error types in php?

0 Answers  


How can you compare objects in php?

0 Answers  


Which is true about the singleton design pattern?

0 Answers  


what are the differences between php and perl

0 Answers   TCS,


What is MIME?

2 Answers  






What is the name of the scripting engine that powers PHP?

0 Answers  


Which function gives us the number of affected entries by a query?

0 Answers  


What is dao in php?

0 Answers  


Explain why would we use === instead of ==?

0 Answers  


How can cross site request forgery csrf be prevented?

0 Answers  


What is cookie and session in php?

0 Answers  


WWhat is the functionality of md5 function in PHP?

7 Answers   Tech Mahindra,


Categories