public static function postBool($name, $default = null) { if (isset($_POST[$name]) && $_POST[$name] !== '') { return (bool) $_POST[$name]; } return is_null($default) ? null : (bool) $default; }