file of caller of my method

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
junky
Forum Commoner
Posts: 30
Joined: Wed Sep 03, 2003 3:58 pm

file of caller of my method

Post by junky »

hi guys,
ive a problem here:
i've a class named Coke.
in that class Coke, i've a method blah.
in my method blah, i wanna print the name of the file calling that method.
i know i can use __FILE__, but its gonna return me the name of my class, no?

How can i grab taht information ?
thanks.
junky
Forum Commoner
Posts: 30
Joined: Wed Sep 03, 2003 3:58 pm

Post by junky »

i've found a solution by myself.

i've to add this into my method:

Code: Select all

global $SCRIPT_NAME;
and if i wanna print the caller of this method: i just need to:

Code: Select all

print $SCRIPT_NAME;
into my method.
Post Reply