RE: [PHP] include files

From: Date: Fri, 19 Dec 2003 23:29:28 +0000
Subject: RE: [PHP] include files
Groups: php.general 
Request: Send a blank email to php-general+get-173052@lists.php.net to get a copy of this message
Todd <mailto:mooseketeer2@sbcglobal.net> on Thursday, December 18, 2003 9:57 AM said: > 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: [snip] > 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. yes this would be very handy for error reporting purposes but alas it is not to be. afaik there is no way to do what you want save passing __FILE__ to the function... functio foo($stuff, $more_stuff, $current_file) { ... do stuff ... } <?php echo foo($thing, $other_thing, __FILE__); ?> that's what i ended up doing. chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/

« previous php.general (#173052) next »