Set_include_path and require, include-php Tutorial

Source: Internet
Author: User
Set_include_path and require. include often uses include and require in PHP to reference other files and use relative or absolute paths. if you use the set_include_path function or ini_set ('include _ path', xxx) if the include_path configuration option is set, The require file can be referenced directly in other directories.

Set include_path configuration options

For example: require_once "class. smarttemplate. php", this file is not actually in the directory where the current file is located, but can be directly referenced in this way. Because the include_path:

// Contains the configuration file and function library path ini_set ('include _ path', INCLUDE_PATH. DS. "library". PATH_SEPARATOR. ini_get ('include _ path '));

Set_include_path function

The set_include_path function has the same effect as the ini_set ('include _ pram', xxx) function, except that the ini_set method is suitable for all PHP versions. for now, there is no difference between the two.

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.