0 Answers
A static variable is that which will not lose its value and will still hold value when the function be called again.
Example:
<?php
function counter() {
STATIC $count = 0;
$count++;
print $count;
print “<br />”;
}
counter();
counter();
counter();
?>
<strong>Output:</strong>
1
2
3
Your Answer