Hi all,
I've been wondering... I'm a big fan of dirname(__FILE__) but
sometimes I have a situation where I would like to know the path of
the file where my function is called.
I'll explain:
file_a.php is:
<?php
include "/path/to/file_b.php";
do_something();
?>
file_b.php is:
<?php
function do_something() {
// I wonder what's the dirname of file_a.php ?
}
?>
I know this can be done using debug_backtrace but it's not really
ideal. I was wondering if someone had this situation and solved it in
some elegant way.
Cheers,
Matt
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---