Friday, October 10, 2025
HomeLanguagesPHP get_include_path() Function

PHP get_include_path() Function

The get_include_path() function is an inbuilt function in PHP that returns the current include_path to the caller.

Syntax:

string|false get_include_path()

Parameter: This function does not accept any parameters.

Return Value: This function returns the path in the string format, or “false” otherwise.

Example 1: In the below code example, we will use the get_include_path() function to the print path.

PHP




<?php
echo get_include_path() ;
?>


Output:

usr/share/php 

Note: Output will be different according to your system.

Example 2: In the below code example, both the paths are compared and the output is printed.

PHP




<?php
$path1 = get_include_path() ;
$path2  = ini_get('include_path') ;
  
if($path1 == $path2){
   echo "Both the paths are same." ;
} else {
    echo "Both the paths are not same." ;
}
?>


Output:

Both the paths are same

Reference: https://www.php.net/manual/en/function.get-include-path.php

RELATED ARTICLES

Most Popular

Dominic
32350 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6718 POSTS0 COMMENTS
Nicole Veronica
11880 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11941 POSTS0 COMMENTS
Shaida Kate Naidoo
6838 POSTS0 COMMENTS
Ted Musemwa
7101 POSTS0 COMMENTS
Thapelo Manthata
6794 POSTS0 COMMENTS
Umr Jansen
6794 POSTS0 COMMENTS