public static function startsWith($haystack, $needles)
    {
        foreach ((array)$needles as $needle) {
            if ($needle == '') {
                continue;
            }

            $substring = mb_substr($haystack, 0, mb_strlen($needle));

            if (self::doesStringMatchNeedle($substring, $needle)) {
                return true;
            }
        }

        return false;
    }
public static function startsWith($haystack, $needles)
    {
        foreach ((array)$needles as $needle) {
            if ($needle == '') {
                continue;
            }

            $substring = mb_substr($haystack, 0, mb_strlen($needle));

            if (self::doesStringMatchNeedle($substring, $needle)) {
                return true;
            }
        }

        return false;
    }
public static function startsWith ( $ haystack , $ needles ) { foreach ( ( array ) $ needles as $ needle ) { if ( $ needle == '' ) { continue ; } $ substring = mb_substr ( $ haystack , 0 , mb_strlen ( $ needle ) ) ; if ( self :: doesStringMatchNeedle ( $ substring , $ needle ) ) { return true ; } } return false ; }
Checks if the given string begins with 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

@return bool
Checks if the given string begins with the given substring .