This is a discussion on Getting the Function name of the Calling Function- How ? within the PHP General forums, part of the PHP Programming Forums category; I guess the Subject is a little ambiguos. I want to get the function name which calls the target function. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I guess the Subject is a little ambiguos. I want to get the function
name which calls the target function. Like function xxx() { .... .... yyy(2,3); } function zzz() { .... yyy(5,6); ..... } function yyy($a,$ab) { ... ... echo "yyy() has been called by the function - ".$functionname; } Now how can I get the name of the function tat calls yyy(). This will be really useful for Error logging purposes. |
|
|||
|
On Oct 12, 9:41 am, Shyam Raj <thanash...@gmail.com> wrote:
> I guess the Subject is a little ambiguos. I want to get the function > name which calls the target function. > > Like > > function xxx() > { > .... > .... > yyy(2,3); > > } > > function zzz() > { > .... > yyy(5,6); > ..... > > } > > function yyy($a,$ab) > { > ... > ... > echo "yyy() has been called by the function - ".$functionname; > > } > > Now how can I get the name of the function tat calls yyy(). > > This will be really useful for Error logging purposes. <http://www.php.net/debug_backtrace> If you're using this for anything other than debugging or error logging it suggests a problem with your code. |
|
|||
|
Tnx a lot pal..
On Oct 12, 7:13 pm, ZeldorBlat <zeldorb...@gmail.com> wrote: > On Oct 12, 9:41 am, Shyam Raj <thanash...@gmail.com> wrote: > > > > > I guess the Subject is a little ambiguos. I want to get the function > > name which calls the target function. > > > Like > > > function xxx() > > { > > .... > > .... > > yyy(2,3); > > > } > > > function zzz() > > { > > .... > > yyy(5,6); > > ..... > > > } > > > function yyy($a,$ab) > > { > > ... > > ... > > echo "yyy() has been called by the function - ".$functionname; > > > } > > > Now how can I get the name of the function tat calls yyy(). > > > This will be really useful for Error logging purposes. > > <http://www.php.net/debug_backtrace> > > If you're using this for anything other than debugging or error > logging it suggests a problem with your code. |