note 44952 added to function.include
| From: | comlampe at aol dot com | Date: | Fri, 20 Aug 2004 23:11:58 +0000 |
| Subject: | note 44952 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-75034@lists.php.net to get a copy of this message | ||
Sometimes its handy to know in a included/required file, from where its been included.
When using get_included_files it returns - even when used inside an included file - the
"base" file name and path. So:
$included_files = get_included_files();
echo $included_files[0];
Or, when needing just the file name:
echo basename($included_files[0]);
--Marco
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44952
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44952&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44952&report=yes
Search -- http://master.php.net/manage/user-notes.php