~Onlooker 2010-03-10 16:13 采纳率: 0%
浏览 408
已采纳

需要、包括、要求一次和包括一次之间的区别?

In PHP:

  • When should I use require vs. include?
  • When should I use require_once vs. include_once?

转载于:https://stackoverflow.com/questions/2418473/difference-between-require-include-require-once-and-include-once

  • 写回答

14条回答 默认 最新

  • Memor.の 2010-03-10 16:17
    关注

    There are require and include_once as well.

    So your question should be...

    1. When should I use require vs. include?
    2. When should I use require_once vs. require

    The answer to 1 is described here.

    The require() function is identical to include(), except that it handles errors differently. If an error occurs, the include() function generates a warning, but the script will continue execution. The require() generates a fatal error, and the script will stop.

    The answer to 2 can be found here.

    The require_once() statement is identical to require() except PHP will check if the file has already been included, and if so, not include (require) it again.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(13条)

报告相同问题?

悬赏问题

  • ¥20 matlab计算中误差
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊