0

Can we use php boolean in switch conditions?

I am try for it ? But boolean not working in switch statements

19th Apr 2020, 5:58 AM
Yaro Ka Yar
Yaro Ka Yar - avatar
1 Answer
+ 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; } ?>
19th Apr 2020, 7:06 AM
A͢J
A͢J - avatar