Include and Require

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Include and Require相关的知识,希望对你有一定的参考价值。

The include or require statement takes all the text/codde/markup that exists in the specified file and copies it into the file that uses the include statement.

The include and require statements are identical, except upon failture:

  • require will produce a fatal error and stop the script
  • include will only produces a warning and the script will continue

So if you want the execution to go on and show users the output, even if the include file is missing, use the include statement.Otherwise, in case of Framework or a complex php application coding, always use the require statement to include a key file to the flow of exectution.This will help you avoid compromising your application‘s security and integrity, just in-case one key file is accidentally missing.

 

include/require ‘filename‘

以上是关于Include and Require的主要内容,如果未能解决你的问题,请参考以下文章

PHPStorm:由include/require引起的未定义变量

nodejs常用代码片段

[RxJS] Implement RxJS `mergeMap` through inner Observables to Subscribe and Pass Values Through(代码片段

环境初始化 Build and Install the Apache Thrift IDL Compiler Install the Platform Development Tools(代码片段

include 和 require 的理解与区别

PHP内的包含语句(include(),require(),include_once(),require_once())