public static function startsWith($string, $substrings)
    {
        if (is_array($substrings)) {
            foreach ((array) $substrings as $substring) {
                if ($substring != '' && mb_strpos($string, $substring) === 0) {
                    return true;
                }
            }
        } elseif (is_string($substrings)) {
            if ($substrings != '' && mb_strpos($string, $substrings) === 0) {
                return true;
            }
        }

        return false;
    }
public static function startsWith($string, $substrings)
    {
        if (is_array($substrings)) {
            foreach ((array) $substrings as $substring) {
                if ($substring != '' && mb_strpos($string, $substring) === 0) {
                    return true;
                }
            }
        } elseif (is_string($substrings)) {
            if ($substrings != '' && mb_strpos($string, $substrings) === 0) {
                return true;
            }
        }

        return false;
    }
public static function startsWith ( $ string , $ substrings ) { if ( is_array ( $ substrings ) ) { foreach ( ( array ) $ substrings as $ substring ) { if ( $ substring != '' && mb_strpos ( $ string , $ substring ) === 0 ) { return true ; } } } elseif ( is_string ( $ substrings ) ) { if ( $ substrings != '' && mb_strpos ( $ string , $ substrings ) === 0 ) { return true ; } } return false ; }
Check if string starts with another string of collection of strings.

@param string       $string
@param string|array $substring

@return bool
Check if string starts with another string of collection of strings .