Using the static Statement to Remember the Value of a Variable Between Function Calls
function aFunction( $txt ) {
static $numCalls = 0;
$numCalls++;
print "$numCalls. $txt
";
}
aFunction("A");
print("static called");
aFunction("B");
print("called again
");
?>