Can anyone help me understand how to pass a variable through a for loop? I want to print out variable $guess until the number 40 & print out either "you guessed to low" or "you guessed too high"...how do I connect the variable with the counter??
$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!";
}
}