Programming Code Center(PCC)
[PHP]

(PCC)::[How-to-Use-the-static-keyword-to-let-a-local-variable-not-be-deleted-after-execution-of-function-in-php]::[php]

File Name : index.php

<!DOCTYPE html>
<html>
<body>

<?php
function myTest() {
    static $x = 0;
    echo $x;
    $x++;
}

myTest();
echo "<br>";
myTest();
echo "<br>";
myTest();
?> 

</body>
</html>

Output :

"; myTest(); echo "
"; myTest(); ?>