Fundamental understanding of while/if conditions and variables


#1


While Loops in PHP: 1.Looping the Loop

Hi,
I don't understand the if condition in the coin flip example. Screenshot: https://gyazo.com/bd419e0daa0f984ab1f10700973e1cb1

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!


#2

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