note 11829 added to function.get-required-files.php
| From: | yasuo_ohgaki at hotmail dot com | Date: | Thu, 08 Mar 2001 23:08:03 +0000 |
| Subject: | note 11829 added to function.get-required-files.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-12084@lists.php.net to get a copy of this message | ||
Example code does not work as explained on my system (Linux/Aapache/PHP4.0.4pl1)
[I also think, there is a little mistake in the example code -
include("util".$i."php");
probably means
include_once('util'.$i.'.php');
(. added before php)
It does not make any difference on the result, though.
I don't care with this kind of little mistakes, but it is still better to fixed :)]
Anyway, BOTH get_included_files() and get_required_files() give the same output. AND both of
functions does show files included/required by includle()/require(). AND array is not associative,
but indexed by number. AND both of them does not care about extention.
Just FYI.
I got following output with the example code.
============
Required_once files
Array
(
[0] => /home/httpd/httpd/html/untitled/local.php
[1] => /home/httpd/httpd/html/inc/global.php
[2] => /home/httpd/httpd/html/untitled/util1.php
[3] => /home/httpd/httpd/html/untitled/util2.php
[4] => /home/httpd/httpd/html/untitled/util3.php
[5] => /home/httpd/httpd/html/untitled/util4.php
)
Included_once files
Array
(
[0] => /home/httpd/httpd/html/untitled/local.php
[1] => /home/httpd/httpd/html/inc/global.php
[2] => /home/httpd/httpd/html/untitled/util1.php
[3] => /home/httpd/httpd/html/untitled/util2.php
[4] => /home/httpd/httpd/html/untitled/util3.php
[5] => /home/httpd/httpd/html/untitled/util4.php
)
http://www.php.net/manual/en/function.get-required-files.php