public static function strIs($patterns, $subject, &$matchedPattern = '', $caseSensitive = false)
    {
        if (!is_array($patterns)) {
            $patterns = (array) $patterns;
        }

        $lowerSubject = strtolower($subject);

        foreach ($patterns as $pattern) {

            if ($caseSensitive) {
                if (str_is($pattern, $subject)) {
                    $matchedPattern = $pattern;
                    return true;
                }
            } else {
                $lowerPattern = strtolower($pattern);
                if (str_is($lowerPattern, $lowerSubject)) {
                    $matchedPattern = $pattern;
                    return true;
                }
            }

        }

        return false;
    }
public static function strIs($patterns, $subject, &$matchedPattern = '', $caseSensitive = false)
    {
        if (!is_array($patterns)) {
            $patterns = (array) $patterns;
        }

        $lowerSubject = strtolower($subject);

        foreach ($patterns as $pattern) {

            if ($caseSensitive) {
                if (str_is($pattern, $subject)) {
                    $matchedPattern = $pattern;
                    return true;
                }
            } else {
                $lowerPattern = strtolower($pattern);
                if (str_is($lowerPattern, $lowerSubject)) {
                    $matchedPattern = $pattern;
                    return true;
                }
            }

        }

        return false;
    }
public static function strIs ( $ patterns , $ subject , & $ matchedPattern = '' , $ caseSensitive = false ) { if ( ! is_array ( $ patterns ) ) { $ patterns = ( array ) $ patterns ; } $ lowerSubject = strtolower ( $ subject ) ; foreach ( $ patterns as $ pattern ) { if ( $ caseSensitive ) { if ( str_is ( $ pattern , $ subject ) ) { $ matchedPattern = $ pattern ; return true ; } } else { $ lowerPattern = strtolower ( $ pattern ) ; if ( str_is ( $ lowerPattern , $ lowerSubject ) ) { $ matchedPattern = $ pattern ; return true ; } } } return false ; }
Checks if a string matches at least one given pattern

@param string|array $patterns
@param string $subject
@param string $matchedPattern
@param bool $caseSensitive

@return bool
Checks if a string matches at least one given pattern