Home >Backend Development >PHP Tutorial >The difference between PHP include and require
Tonight we will talk about the difference between include() and require() in PHP system functions. We often use these two methods. Normally, their
differences are not reflected. Yes, but once an unexpected situation occurs, the difference will immediately appear. Let’s talk about it in detail below.
include(): In English, it means to include. It is often used to introduce a file into a page or include another page. When the imported file
does not exist, the system will prompt An error, but the program will still continue to execute ;
require(): Literally, it means request or need, and is often used to introduce a file on the page, but when the file does not exist , the process
program will no longer continue to execute, and will terminate execution.
I believe you will never have any doubts about these two methods in the future. It is very simple. Well, the sharing ends here. If it is useful, just tip. Thank you!
The above introduces the difference between PHP include and require, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.