include files

From: Date: Thu, 18 Dec 2003 17:56:39 +0000
Subject: include files
Groups: php.general 
Request: Send a blank email to php-general+get-173050@lists.php.net to get a copy of this message
Hi, Is it possible under PHP4 to get the name of the file that a function was called from? To clarify, here's an example of what I'd like to do: --- main.php --- <?php include('include.php'); function foo(){ $include_file=file_that_called_foo(); printf($include_file); } ?> --- include.php --- <?php foo(); ?> Does anyone know of a way to do this? I've tried several different things, including to constant '__FILE__ ', but they all return the current file, I am needing the included filename.

« previous php.general (#173050) next »