set_include_path

set_include_path

(PHP 4 >= 4.3.0, PHP 5)

set_include_path --  Establece la opci贸n de configuraci贸n include_path

Descripci贸n

string set_include_path ( string nueva_ruta_inclusion )

Establece la opci贸n de configuraci贸n include_path durante la duraci贸n del script. Devuelve el valor antiguo de include_path en caso de 茅xito, o FALSE en caso de fallo.

Ejemplo 1. Ejemplo de set_include_path()

<?php
// Funciona a partir de PHP 4.3.0
set_include_path('/inc');

// Funciona en todas las versiones de PHP
ini_set('include_path', '/inc');
?>

Ejemplo 2. A帽adir a la ruta de inclusi贸n

Haciendo uso de la constante PATH_SEPARATOR es posible extender la ruta de inclusi贸n independientemente del sistema operativo.

En este ejemplo agregamos /usr/lib/pear al final del valor include_path actual.

<?php
$ruta
= '/usr/lib/pear';
set_include_path(get_include_path() . PATH_SEPARATOR . $ruta);
?>

Vea tambi茅n ini_set(), get_include_path(), restore_include_path(), e include().