<?php $present=1; $min=1; $max=4; function sub() { global $present; global $max; global $min; if($present==$min) { $present=$max; } $present--; return $present; } echo sub();//it works only once echo sub(); echo sub(); ?>
You have javascript disabled. You will not be able to edit any code.