Hello,
I Want to check whether a function is called for the last time. Consider the following sample code,
function foo(){
if( this is the last call ) {
echo 'this is the last call of this function';
}
}
foo(); // should not print
foo(); // should not print
foo(); // since this is the last call, it should print
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 ?