How to Check whether the function is called for the last time in PHP

hzxtvu1997

New Member
I Want to check whether a function is called for the last time. Consider the following sample code, \[code\]function foo(){ if( this is the last call ) { echo 'this is the last call of this function'; }}foo(); // should not printfoo(); // should not printfoo(); // since this is the last call, it should print\[/code\]In my project, i need the condition statement to be present within the function.I had a idea of using constants/global variables/counters but don't no how to implement.Any ideas to detect the last call of the function ?
 
Back
Top