誰能幫助我瞭解如何通過傳遞一個變量的循環?我想輸出變量$ guess,直到40 &打印出「你猜到低」或「你猜得太高」......如何將變量連接到計數器?比索傳遞變量通過一個for循環
$Me=30;
$guess=$i;
for ($i = 0; $i < 40; $i++) {
if($Me>$guess){
print "$guess:you guessed too low<br />";
}elseif($Me<$guess){
print "$guess: you guessed to high<br />";
}else{
print "you guessed my age! i'm 31!";
}
}
謝謝llya! – Vynce82