标签归档:include

/*
 * include() require()。
 * 这两种结构除了在如何处理失败之外完全一样。
 * include() 产生一个警告而 require() 则导致一个致命错误。
 * 换句话说,如果想在遇到丢失文件时停止处理页面就用 require()。
 * include() 就不是这样,脚本会继续运行。
 *
 * include_once() require_once()
 * 如果该文件中的代码已经被包含了,则不会再次包含。
 * 错误处理方式和include() require() 相同。
 */

继续阅读 PHP include include_once require require_once 区别

It is not often that you can write a PHP script that does not need to include the contents of different files as part of it’s output. If these includes happen to be php scripts themselves you have no choice but to use require or include. However more often than not, the contents are static, usually html template component. With static includes you have many more options available. aerwear We will analyse some of these functions to find out which one is most suitable when dealing with files with static content. We use the term function loosely, because require and include are not real functions but language constructs. 继续阅读 PHP各种读取文件的函数效率对比