06-14-2010, 03:44 PM
|
#1 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Getting classname where function was called from
How would I get the classname of a class where I called another class's function?
one.php
PHP Code:
class One {
public static function test() {
echo Two::test();
}
}
two.php
PHP Code:
class Two {
public static function test() {
return 'You called this from: ' . $something;
}
}
Calling One::test() would echo out:
You called this from: One, or
You called this from: one.php, or
You called this from: path/to/file/one.php
Is that possible??
__________________
|
|
|
|