$ 0 0 PHPにはstatic変数という仕組みが存在します。 function foo(){ static $i = 1; echo $i++; } foo(); // 1 foo(); // 2 foo(…