It seems that the static variable declared in the function is re-triggered whenever the function is called, how can I use this function so that re-calling the function reuses the static parameter?
I defined the testStatic function in static.php
here is static.php:
<?php
function testStatic()
{
static $staticV = 0;
echo $staticV;
$staticV;
}
?>
I call "testStatic" from index.php
here index.php:
<?php include "./static.php";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3c.org/TR/html4/strict.dtd">
<?php
testStatic();
?>
<html>
.
.
.
<html>
index.php , testStatic '0', index.php. testStatic '0'.
, 'staticV' 'testStatic' , index.php.
.
index.php