Fundamental understanding of while/if conditions and variables


While Loops in PHP: 1.Looping the Loop

I don't understand the if condition in the coin flip example. Screenshot:

Shouldn't it be saying:

if ($flip = 1) { }

?In this case we check if the variable flip is 1, which would mean its Head. If I do so the program doesn't work all flips are heads. It would be super awesome if someone could explain why it doesn't work like that.
Thanks in advance!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.