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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is php resource type?

713


What is the use of ajax in php?

701


What is meant by public, private, protected, static and final scopes?

748


Is server side a session?

664


How do I find environment variables?

691


What is the use of trim function in php?

719


What is session in c#?

726


What are some of the advanced features of php?

707


What does it mean when it says the csrf token is invalid?

675


Are php sessions cookies?

708


What is the difference between php traits vs interfaces?

684


When use javascript vs php?

751


What are objects in php?

709


How can we enable error reporting in php?

689


What is cookie and session in php?

692