一、require 与 include 的区别:

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.

这两个方法基本没有区别,除了在错误处理方面的。如果使用 include 方法出错,这个方法抛出一个warning,不影响程序的继续执行,但是 require 方法产生一个  fatal error,程序运行终止。

二、require 与 require_once 的区别:

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.

这两个方法的区别在于如果使用 require_once php 会检查需要包含的文件是否已经被包含了,如果是,那么就不会重新包含。

最新文章

  1. hadoop2.2编程:MRUnit测试
  2. cocos2dx骨骼动画Armature源码分析(一)
  3. javascript(定时函数)
  4. 如何录制手机屏幕并转成gif
  5. ACM/ICPC 之 DFS求解欧拉通路路径(POJ2337)
  6. Abap 多线程
  7. Mac下搭建Eclipse Android开发环境
  8. HDU 4978 A simple probability problem
  9. Php 使用 fsockopen发送http请求
  10. python类继承
  11. 【踩坑】360安全浏览器“极速模式”和“兼容模式”,套路还是bug?
  12. Echarts数据可视化series-line线图,开发全解+完美注释
  13. LeetCode 48. Rotate Image(旋转图像)
  14. c语言的流程控制
  15. 剑指Offer——中国银行面试知识储备
  16. php封装curl,模拟POST和GET请求HTTPS请求
  17. gh-ost的延迟控制机制
  18. 使用NodeJs搭建的小型web应用
  19. 洛谷P1503 鬼子进村 [平衡树,STL]
  20. 编写第一个Shell脚本

热门文章

  1. Python(Django) 连接MySQL(Mac环境)
  2. [.Net MVC] 使用 log4net 日志框架
  3. PHP递归
  4. Blu-Ray BRRip 和 BDRip 的区别
  5. jquery ajax php+mysql 无刷新分页 详细实例
  6. Convert.ToInt32()与int.Parse()的区别 (转载)
  7. 重新开始学习c#啦,希望能坚持下去!
  8. sublime主题推荐
  9. PHP常见算法-面试篇(2)
  10. phpcms前端页面上传文件