PHP: Hypertext Preprocessor (original) (raw)
`To check if a variable is boolean is one thing, to evaluate if the value of a variable represents a boolean condition (true or false) is another.
Here is a simple function that checks the status of the received variable in regard to boolean equivalencies (case-insensitive).
Of course, it is a simplistic approach, but for the majority of cases it will do the job right.
And, just to put the thing from the right perspective, here's a real function that does what Phill disclosed:
I hope it helps someone. Happy coding.
`