0
I can't understand what is different between require and include 😑
5 Respostas
+ 4
with include you have to write every time that include this page include this header file etc.
but with require is used for the required file without which your script will not run
+ 1
The key difference between require() and include() is that if you require() a file that
can't be loaded (eg if it isn't there) then it generates a fatal error which will halt the execution of the page
completely, and no more output will be generated. On the other hand, if you include() a file that can't be loaded,
then this will merely generate a warning and continue building the page
- 1
u should use include for including files that aren't so important, like the text fields we need to fill when opening a new email id. some fields are required and some are optional. optionals are created using require and the rest are created using require.
- 1
here is a very ..simple ...in the include function... if your add file not exiest so your result is display .main page + warning
and if u use require so the result is
only warning it gives only error... understood
- 1
the different is the way to handle error.