There are problems with booleans in php, it would be very grateful if someone could explain why not Does
$ var = "asdas"; // or if this (! Private ($ var) || ($ var &! Var)) {if (! Isset ($ var) || (is_bool ($ var)! = True & amp; Is_bool ($ Var)! = False)) {echo "is not boolean"; } Else {echo "This is a boolean"; } Output is always - & gt; "This is a bullion"
Thank you in advance
Thank you for your help, yes I know what I have done (school boy error).
Solution
$ var = "asda"; If (! Isset ($ var) || (is_bool ($ var) === false)) {resonant "this is not a boolean"; } Else {resonance is "boolean"; }
The problem is here:
(Is_bool ($ Var)! = True & amp; is_bool ($ var)! = False) is_bool () either returns Code> or False so that you are destroying the first echo .
Change your code to:
$ Var = "Dadas"; If (isset ($ var) and is_bool ($ var)) {echo "this is a boolean"; } And {resonance is not "boolean"; }
Comments
Post a Comment