I'm obviously an out and out beginner, however before I start thanks for having me on your forum.
I'm just starting out with php and I've been following the lessons on Code Academy. In one section with While Loops they do a small script of tossing a coin and the coin has to land 3 times on heads for the script to stop.
I've attached the script.
What I don't understand is how php knows that in the $flip=rand(0,1) that 1 is heads and 0 is tails.
Also, in the if statement it just say if($flip).
Why do I not have to write if($flip=1) so that it identifies 1 from the rand as being heads?
Thanks Al.[ATTACH]5191[/ATTACH]
heads.png