How to get list of files included in PHP.??

Every time I write a peace of PHP code, to perform database activity or calculations, I’m curious about how many files are included, by framework (CodeIgniter,Yii, Zend etc.).

My moto  is, just don’t want to include those files, which are not taking any part in my logic, like if I am not doing any database activity, I don’t want to include database connection file.

PHP, know them all. It has function which give me list of that.

get_included_files() Returns an array with the names of included or required files

alias get_required_files()

we can check it with below code,

$includedFiles = get_included_files();
foreach ($includedFiles as $filename) {
echo $i++.’) ‘.$filename.'<br />’;

How to get php functions & public user defined functions?

get_defined_functions() – Returns an array of all defined functions

It returns array([internal]=>(….),[user]=>(….))


$arr = get_defined_functions();

echo ‘<pre>’; print_r($arr);

Comments/Suggestions are always welcome.

Posted in PHP
One comment on “How to get list of files included in PHP.??
  1. amazing article, make me like to read it. thanks i’ll try at home

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: