Static Variable in PHP
What is Static Variable in PHP?
PHP Static variable is declared using a keyword "static". It remains in local scope but retains the value till the program execution completes.
In the above syntax, static is a keyword and varname is the variable name.
In the above example, the variable $count is declared as static variable. So, it won't be initialized each time when the function count() is called.