public static function hasSubstring($haystack, $needles, $characterEncoding = 'UTF-8')
    {
        foreach ((array)$needles as $needle) {
            if ($needle == '') {
                continue;
            }

            if (mb_strpos($haystack, $needle, 0, $characterEncoding) !== false) {
                return true;
            }
        }

        return false;
    }
public static function hasSubstring($haystack, $needles, $characterEncoding = 'UTF-8')
    {
        foreach ((array)$needles as $needle) {
            if ($needle == '') {
                continue;
            }

            if (mb_strpos($haystack, $needle, 0, $characterEncoding) !== false) {
                return true;
            }
        }

        return false;
    }
public static function hasSubstring ( $ haystack , $ needles , $ characterEncoding = 'UTF-8' ) { foreach ( ( array ) $ needles as $ needle ) { if ( $ needle == '' ) { continue ; } if ( mb_strpos ( $ haystack , $ needle , 0 , $ characterEncoding ) !== false ) { return true ; } } return false ; }
Checks if the given string contains the given substring.

When passing an array of needles, the first needle match
returns `true`.  Therefore, only one word in the array
needs to match.

@since 3.0.0

@param string $haystack The given string to check
@param string|array $needles The substring(s) to check for
@param string $characterEncoding (optional) Character encoding
Default is 'UTF-8'.

@return bool
Checks if the given string contains the given substring .