<?php
$gue=rand(1,100);
B:
print "猜一个数(1-100):\n";
A:
fscanf(STDIN,"%d",$i);
if(!is_int($i)){
print "请输入一个数字:\n";goto A;
}
if($i<$gue){
echo "小了!\n ";
goto A;
} elseif($i>$gue){
echo "大了!\n";
goto A;
}
echo "恭喜答对了!\n是否继续?输入'y'继续\n";
fscanf(STDIN,"%c",$a);
if($a=='y') goto B;
?>