I\'m getting a string from a $_GET and I want to test if it could be a boolean, before I use it for a part of a mysql query. Is there a better way of doing it than:
You can either use is_bool() or as suggested on php.net:
is_bool()
http://php.net/manual/en/function.is-bool.php
The latter one will accept strings like "on" and "yes" as true as well.