How can the include_path be manipulated using ini_set() or set_include_path() to ensure proper functioning of PEAR packages in PHP scripts?

To ensure proper functioning of PEAR packages in PHP scripts, the include_path needs to be set correctly to include the directory where PEAR packages are installed. This can be done using either ini_set() function or set_include_path() function in PHP.

// Using ini_set() function
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '/path/to/pear/packages');

// Using set_include_path() function
set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/pear/packages');