What is the difference between PHP require and include?

后端 未结 7 908
时光说笑
时光说笑 2020-11-30 12:35

I know the basic usage of PHP require, require once, include and include once. But I am confused about when I should use them.

Example: I have 3 files, eg: settings.

相关标签:
7条回答
  • 2020-11-30 13:09

    include_once and require_once use in Php for add one page to another page example:you want to add database connection page conn.php in edit page edit.php you can use it. But there is different between include_once and require_once if include_once function get any error it will be warning you and execute the code but require_once function find any error it will stop the script and do not execute the code .

    0 讨论(0)
提交回复
热议问题