Description
array get_required_files
(void)
This function returns an associtative array of the names of all
the files that have been loaded into a script using
require_once(). The indexes of the array are
the file names as used in the require_once()
without the ".php" extension.
The example below
Example 1. Printing the required and included files
<?php
require_once ("local.php");
require_once ("../inc/global.php");
for ($i=1; $i<5; $i++)
include "util".$i."php";
echo "Required_once files\n";
print_r (get_required_files());
echo "Included_once files\n";
print_r (get_included_files());
?>
|
|
will generate the following output:
Note:
As of PHP 4.0.1pl2 this function assumes that the
required_once files end in the extension
".php", other extensions do not work.
See also: require_once(),
include_once(),
get_included_files()