php中include()和require()区别

经常在编程中遇到include()和require()函数。对他们的区别却不是很了解。查询google.com(searching "include  requirement difference")得到下面一个结论,好像在哪看到过

“The difference is that if we use require_once() then the file to be added should exist in the given path,if not it will display a fatal error.if we use a include_once there will be no more problem due to this ,if there exist no such file.if we need to include a file then we will prefer include_once() because it will include the file once,it willnot include the file if it is inluded earlier”

就是说用require()函数的时候如果没有包含的文件的时候,回提示错误。而用inc lude()的时候应该是警告。这好像是他们的区别。区别对于编写程序的人来说不是很大。

我相信大家都知道require_once()和require()的区别吧。如果有什么问题,欢迎大家给我留言。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值