What is the difference between PHP require and include?

后端 未结 7 950
时光说笑
时光说笑 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 12:53

    require_once would check if the file is already included and not include it again, so don't worry it won't load settings.php twice.

提交回复
热议问题