lets say i have a function add().
function add(){
if (a)
return true;
if (b)
return true;
if (c)
insert into table.
return true;
}
now i call this function add() and i want to increment my counter only if there is insert execution like condition C. I also don't want to change the return value which is true. Now my question is how can i find out if section C is executed? I thought i can use a global variable in condition c like below
if (c)
{
insert into table.
$added = true;
return true;
}
and then i check
if(isset($added && $added==true))
$count++;
but i would like to know if there is any parameter i can add or some other approach i can use?