mardi 30 août 2016

PHP Boolean true/false issue in 'if' statement [duplicate]

The following code

$status = true;

if($status == 'all') {
  echo "Hello!";
} else {
  echo "Bye!";
}

outputs "Hello" when $status = true, but "Bye" when $status = false. Why is that the case?

Aucun commentaire:

Enregistrer un commentaire