1,845   PHP

主要区别:
1,require文件报错级别是Error,出错后就会停止主程序执行了
2,include文件报错级别是Waring,出错后主程序继续执行下去

使用建议:
1,为了避免重复加载,可以使用require_once和include_once;
2,为了保证加载文件的安全以及正确性,官网推荐使用require




Leave a Reply

Your email address will not be published. Required fields are marked *