0
Can we use php boolean in switch conditions?
I am try for it ? But boolean not working in switch statements
1 Odpowiedź
+ 1
Yes we can use. Copy this code in Sololearn Playground and run.
<?php
$bool = true;
switch($bool) {
case true:
echo "true";
break;
case false:
echo "false";
break;
}
?>