Differentiate between require and include?



Differentiate between require and include?..

Answer / Rani

In PHP, both 'include' and 'require' are used to include a file into another. The main difference is that if an error occurs while including a file with 'require', the script will stop running. With 'include', it will only give a warning and continue running. Also, 'require' checks for the existence of the file before executing the script, while 'include' does not necessarily check for file existence before executing.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

Is empty in php?

1 Answers  


What are php magic quotes?

1 Answers  


What is default session time and path in PHP. How to change it?

1 Answers  


What are the differences between Get and post methods in form submitting, give the case where we can use get and we can use post methods?

11 Answers   HCL, Rushmore Consultancy, Thursday Technology,


List some string function name in php?

1 Answers  


Does php 5 support exceptions?

1 Answers  


Is php class name case sensitive?

1 Answers  


When to use get and post request?

1 Answers  


What is mysql in php?

1 Answers  


How to increase the maximum execution time of a script in php?

1 Answers  


What is the best way to change the key without changing the value of a php array element?

1 Answers  


What is html used for?

1 Answers  


Categories