5/7 do / while


#1

$flipCount = 0;
do {
$flip = rand(0,1);
$flipCount ++;
} while ($flip);
i don't understand the "while($flip)" part, the rest is understandable but while($flip) is the same as while($flip == true) , how can $flip be "True" when its either 1 or 0?


#2

Hello, in PHP, the integer 0 is considered false.
Any other integer is true.

See
http://php.net/manual/en/language.types.boolean.php