RE: [PHP] Which file called the function?

From: Date: Fri, 21 Dec 2007 15:32:37 +0000
Subject: RE: [PHP] Which file called the function?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-266204@lists.php.net to get a copy of this message
__FILE__ == "global.php" On 20/12/2007, Christoph Boget <jcboget@yahoo.com> wrote: > > 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 > -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165

« previous php.general (#266204) next »