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 beforeRender() used?

825


hello all, I need some sample placement papers in lion bridge.. can anyone help me?

1803


What is the actually used php version?

739


What is the difference between public, protected and private?

688


What does the scope of variables means?

780


How do you use an array in excel?

754


What is the difference between indexed and associative array?

738


What is input sanitization in php?

726


What is a stored procedure in mysql?

778


What is laracast?

795


How to replace a text in a string with another text in php?

743


What are the benefits of using php and mysql?

726


Can you give example for trait in php?

744


Explain how to submit form without a submit button.

732


Differentiate echo vs. Print statement.

720