0
While Loop
$x = 0; while($x<=7) { $x++; } echo $x; //output 8 I don't get why the output is * can somebody explain to me pls
3 odpowiedzi
+ 3
x=0, x<=7 so increase x
x=1, x<=7 so increase x
x=2, x<=7 so increase x
x=3, x<=7 so increase x
.
.
.
x=7, x<=7 so increase x
x=8, x <= 7 is incorrect so end while
print x that is 8
0
so its about where i put the echo?
0
echo only display the var value.. The important its whicj value has that var when its displayed