Introduction to Set_include_path and Require,include in PHP

Source: Internet
Author: User
Tags require

Include,require is often used in PHP to refer to other files, using relative paths or absolute paths, if the Set_include_path function or Ini_set (' include_path ', XXX) is set Include_ Path configuration option, the Require file can also be referenced directly in other directories.

Set Include_path configuration options

such as: require_once "class.smarttemplate.php", this file is not in fact the current file directory, but also can be directly referenced. Because the front is set by the Ini_set include_path:

Php

Include 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 is the same as the Ini_set (' Include_pah ', XXX), except that the Ini_set way is suitable for all PHP versions, and there is no difference between them now.

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.