Which file called the function?
| From: | Christoph Boget | Date: | Thu, 20 Dec 2007 14:37:27 +0000 |
| Subject: | Which file called the function? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-266151@lists.php.net to get a copy of this message | ||
Let's say I have the following 3 files
global.php
<?
function myFunc() { echo __FILE__; }
?>
one.php
<?
include( 'global.php' );
echo 'You are in file: ';
myFunc();
?>
two.php
<?
include( 'global.php' );
echo 'You are in file: ';
myFunc();
?>
In each case, what is echoed out for __FILE__ is global.php. Apart from
analyzing the debug_backtrace array, is there any way that myFunc() would
display "one.php" and "two.php" respectively?
thnx,
Christoph