i select a random number from an array.
$base = array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52");
$var = $base[rand(0,51)];
echo "<br>\$var = $var";
think there is a sumbit button bottom of this code.
when i press submit. i want $var to be static and show the number (which is selected once from array with rand() )
after i press the submit button again i want the first number should stay in the screen and $var should choose a new value from array randomly.
for example.
i pressed submit once.
output maybe:
$var=3
then i pressed submit again:
output: ($var should still be 3)
$var=3
$var=4
then i pressed submit again;
output:
$var=3
$var=4
$var=5
like these.
how can i do that ?