PHP set_include_path Function Settings include_path configuration options _php Instance

Source: Internet
Author: User
Tags pear

The Set_include_path () function can dynamically change PHP's include_path parameters in a PHP program, which is a string, and multiple different directories can be concatenated together as a parameter--separate directories using a directory split symbol, In a Unix-like system, this delimiter is ":" In the Windows system this delimiter is ";", so PHP provides a constant path_separator to represent this delimiter in the current system.

set_include_path-Set Include_path configuration options

Description

String Set_include_path (String $new _include_path)

Sets the configuration options for the Include_path runtime for the current script.

Parameters

New_include_path

Include_path the new value.

return value

Returns an old include_path on success or returns FALSE on failure.

Instance One

<?php
///from PHP 4.3.0 available
set_include_path ('/usr/lib/pear ');
ini_set (' include_path ', '/usr/lib/pear ') are available in all versions of PHP.
>
 

Example Two

Add to include path

Use constant Path_separator to extend include PATH across platforms.

In this example we add/usr/lib/pear to the tail of the existing include_path.

<?php
$path = '/usr/lib/pear ';
Set_include_path (Get_include_path (). Path_separator. $path);
? >

Thank you for reading, I hope to help you, thank you for your support for this site!

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.