Include,include_once,require,require_once the difference, requireonceinclude_php tutorial

Source: Internet
Author: User

The difference between include,include_once,require,require_once and Requireonceinclude


1. Include,require contains a file at the location where it was called.

2. The Include_once,require_once function is the same as include, but it first verifies that the file is already included. If it is already included, Include_once is no longer executed. Other same as include.

3, require and include the main difference, a, require error, the script will stop running, and include error in the case, the script will continue to execute. b, regardless of the location of the require, the development files will be included in the script that appears require. For example, even if the require is placed in an if statement that evaluates to FALSE, the specified file will still be included.

4, use require_once can solve the problem that the file is overwritten. The Require_once function ensures that the file is included only once. After encountering require_once, the subsequent attempt to include the same file is ignored.

http://www.bkjia.com/PHPjc/1069667.html www.bkjia.com true http://www.bkjia.com/PHPjc/1069667.html techarticle the difference between include,include_once,require,require_once, Requireonceinclude 1, Include,require contains a file at the location where it was called. 2. The Include_once,require_once function ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.