Home >Backend Development >PHP Tutorial >The difference between PHP include and require

The difference between PHP include and require

WBOY
WBOYOriginal
2016-07-29 09:08:55784browse

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!

PHP include与require的区别

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Thinkphp框架感悟(一)Next article:ARM上移植PHP5530