require和include与php有什么区别?

前端之家收集整理的这篇文章主要介绍了require和include与php有什么区别?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
参见英文答案 > Difference between “include” and “require” in php7个
我想知道何时应该使用include或require以及每个的优点是什么.
require要求,include包括.

根据手册:

require() is identical to include() except upon failure it will produce a fatal E_ERROR level error. In other words,it will halt the script whereas include() only emits a warning (E_WARNING) which allows the script to continue.

猜你在找的PHP相关文章