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

name of the calling method

P: n/a
Hi,

I'd like to get the name of the calling method. I can't find the solution.
For example :

function MyFct()
{
return TheOtherFct() ;
}

function TheOtherFct()
{
echo "Hi, the calling method is ..." ;
return true ;
}

MyFct() ;
Thank you for your help,

gizz
May 8 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"gizz" <gi**@nospam.orgwrote in message
news:46*********************@news.free.fr...
Hi,

I'd like to get the name of the calling method. I can't find the solution.
For example :

function MyFct()
{
return TheOtherFct() ;
}

function TheOtherFct()
{
print_r(debug_backtrace()); // It's in there somewhere
echo "Hi, the calling method is ..." ;
return true ;
}

MyFct() ;
see http://fi2.php.net/debug_backtrace for documentation

--
Ra*********@gmail.com

"Good tea. Nice house." -- Worf
May 8 '07 #2

P: n/a
gizz wrote:
Hi,

I'd like to get the name of the calling method. I can't find the solution.
For example :

function MyFct()
{
return TheOtherFct() ;
}

function TheOtherFct()
{
echo "Hi, the calling method is ..." ;
return true ;
}

MyFct() ;
Hi, just check if the output of debug_backtrace fullfill your expectations.

hth,
Roy
May 8 '07 #3

P: n/a
function TheOtherFct()
{
echo "Hi, the calling method is ..." ;
return true ;
}
MyFct() ;
Under Foxpro, u could use program().
--
iTech Consulting Services Limited
Expert in ePOS (Point-Of-Sales) solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288
May 8 '07 #4

P: n/a
thanks you all for your help, the debug_backtrace function is exactly what i
was searching for.
gizz
May 8 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.