Is it possible?
function test()
{
echo "function name is test";
}
The accurate way is to use the __FUNCTION__
predefined magic constant.
Example:
class Test {
function MethodA(){
echo __FUNCTION__;
}
}
Result: MethodA
.
You can use the magic constants __METHOD__
(includes the class name) or __FUNCTION__
(just function name) depending on if it's a method or a function... =)
function name1()
then use name1 again inside), would save lots of time if you have the same template for lots of functions. – Mafia