PHP – convert parameter to boolean

In short, here is the snippet converting parameter from POST/GET to boolean:

if (isset($_GET['debug'])) {
        $DEBUG = filter_var($_GET['debug'], FILTER_VALIDATE_BOOLEAN);
    }

Leave a Reply

Your email address will not be published.




Enter Captcha Here :