PHP get_included_files() Function Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The get_included_files() is an inbuilt function that returns an array with names of included or required files. Syntax: get_included_files(): array Parameters: This function does not accept any parameters. Return Values: It returns an array of the names of files. Example 1: This example demonstrates the get_included_files() function. PHP <?php include 'print.php'; $nameFile = get_included_files() ; var_dump($nameFile) ; ?> Note: The included file has to be present in the correct directory. In this example, it's 'print.php'. Output: array(2) { [0] => string(51) "/home/dachman/Desktop/Articles/GFG/Method/index.php" [1] => string(51) "/home/dachman/Desktop/Articles/GFG/Method/print.php"} Example 2: The following code also demonstrates the get_included_files() function. Note: The output this these programs must be different according to your system path or where you store your files. PHP <?php include 'print.php'; $nameFile = get_included_files() ; foreach($nameFile as $filename){ echo $filename."\n" ; } ?> Output: /home/dachman/Desktop/Articles/GFG/Method/index.php /home/dachman/Desktop/Articles/GFG/Method/print.php Reference: https://www.php.net/manual/en/function.get-included-files.php Comment More infoAdvertise with us Next Article PHP file_get_contents() Function N neeraj3304 Follow Improve Article Tags : PHP PHP-function Similar Reads 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. 1 min read PHP is_file( ) Function The is_file() function in PHP is an inbuilt function which is used to check whether the specified file is a regular file or not. The name of the file is sent as a parameter to the is_file() function and it returns True if the file is a regular file else it returns False. Syntax: bool is_file($file) 2 min read PHP get_loaded_extensions() Function The get_loaded_extensions() is an inbuilt function that returns an array of loaded and compiled modules in PHP. Syntax: get_loaded_extensions(bool $zend_extensions = false): Parameters: This function has only one parameter. $zend_extensions: It only returns zend extensions, if not then regular exten 2 min read PHP file_get_contents() Function In this article, we will see how to read the entire file into a string using the file_get_contents() function, along with understanding their implementation through the example.The file_get_contents() function in PHP is an inbuilt function that is used to read a file into a string. The function uses 3 min read PHP | filesize( ) Function The filesize() function in PHP is an inbuilt function which is used to return the size of a specified file. The filesize() function accepts the filename as a parameter and returns the size of a file in bytes on success and False on failure. The result of the filesize() function is cached and a funct 2 min read PHP | fileperms( ) Function The fileperms() function in PHP is an inbuilt function which is used to return the permissions given to a file or a directory. The filename of the file whose permissions have to be checked is sent as a parameter to the function and it returns the permissions given to the file in the form of numbers 2 min read Like