+ 8
Does a string of 'false' evaluate to Boolean in PHP?
I think I've seen a couple of challenge questions about this whose answers I thought were inconsistent. Just trying to find out from any PHP pros.
4 Respostas
+ 4
Thanks Lexus Collins for the explanation code. I left a small question there for you in the comments.
+ 3
Every string with something inside returns true and empty string returns false.
+ 2
Any value enclosed in double or single quotes is seen as a string value, so 'false' will not evaluate to Boolean unless you manually convert it to a Boolean.