WhichBrowser\Data\DeviceModels::hasMatch PHP Method

hasMatch() public static method

public static hasMatch ( $pattern, $model )
    public static function hasMatch($pattern, $model)
    {
        if (substr($pattern, -2) == "!!") {
            return !!preg_match('/^' . substr($pattern, 0, -2) . '/iu', $model);
        } elseif (substr($pattern, -1) == "!") {
            return !!preg_match('/^' . substr($pattern, 0, -1) . '/iu', $model);
        } else {
            return strtolower($pattern) == strtolower($model);
        }
    }