YaoRaoLov 2010-03-10 16:13 采纳率: 50%
浏览 432
已采纳

需求之间的差异,包括,需求一次,包括一次?

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条回答 默认 最新

  • Lotus@ 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条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器