What is the difference between include and required. In php? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

What is the difference between include and required. In php?

i want to know the basic differences in php include and required function

27th Feb 2017, 9:25 AM
irfan
irfan - avatar
1 ответ
+ 3
include("file) : if you use it, even if php doesn't find this file..it will continue to run..rest of the things will work require("file") : require make it necessary to find file else it will show fatal error and code will not work after that. use require if it is really necessary to include that file, like you are saving menu files and you must have to attach it in every page.
27th Feb 2017, 9:50 AM
Raj Kumar Chauhan
Raj Kumar Chauhan - avatar