What are the differences between require and include,
include_once?

Answer Posted / sri harsha

include();--> include the file, but in case of file missing
throws a warning and continues execution of code of next line.

require();--> require also includes the file but in case of
file missing throws an fatal error and stop the execution of
the code of next line.

include_once();-->if same file was included first it will
not include the file another time.

Is This Answer Correct ?    46 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between static and constant in php?

735


How long is csrf token?

718


What is the most common http method?

782


Is set in php?

753


What is call by reference in php?

768


Name some of the popular frameworks in php.

755


How to track no of user logged in?

834


Why php is used in html?

707


What library is used for pdf in php?

776


What is the difference between $name and $$name?

757


What is a collection in php?

707


Tell me is it possible to remove the html tags from data?

712


Will php die?

718


Define soundex()?

703


What is difference between isset and empty in php?

759