Re: include files

From: Date: Sat, 20 Dec 2003 06:27:04 +0000
Subject: Re: include files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-173055@lists.php.net to get a copy of this message
See function debug_backtrace(), it's available since 4.3.3 Todd wrote:
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 (#173055) next »