What is the purpose of the include_path in PHP and how can it be utilized effectively?

The include_path in PHP is used to specify a list of directories where PHP will look for files when using include, require, include_once, or require_once functions. By setting the include_path correctly, you can easily include files from different directories without specifying the full path each time.

// Set the include_path to include multiple directories
set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/directory1' . PATH_SEPARATOR . '/path/to/directory2');

// Now you can include files from these directories without specifying the full path
include 'file1.php';
require_once 'file2.php';