By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

Name of function ?

P: n/a
All,
This may sound silly, but, is there a way to get the name of the function
that is running from inside of the function ?
For example,

function test()
{
echo "i am running the ??? function";
}
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In message-id <10*************@corp.supernews.com>,
News wrote:
All,
This may sound silly, but, is there a way to get the name of the function
that is running from inside of the function ?
For example,

function test()
{
echo "i am running the ??? function";
}


__FUNCTION__

see http://www.php.net/manual/en/languag...predefined.php

for PHP >= 4.3.0

function test()
{
$functionName = __FUNCTION__;
echo "i am running the $functionName function";
}

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.