What is the purpose of setting the include_path in PHP and how does it affect the usage of libraries like Smarty and PEAR?

Setting the include_path in PHP allows you to specify directories where PHP should look for included files. This can be useful when working with libraries like Smarty and PEAR, as it ensures that PHP can find and load the necessary files from these libraries without having to specify the full path each time.

// Set the include_path to include the directories where Smarty and PEAR libraries are located
set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/smarty/libs' . PATH_SEPARATOR . '/path/to/pear/libs');

// Now PHP will be able to find and load files from Smarty and PEAR without specifying the full path