public static function startsWith($value, string $search, string $encoding = 'UTF-8'): bool
    {
        if (!static::isStringCastable($value)) {
            return false;
        }

        $searchlen = (int) mb_strlen($search, $encoding);
        $start = mb_substr((string) $value, 0, $searchlen, $encoding);

        return $search === $start;
    }
public static function startsWith($value, string $search, string $encoding = 'UTF-8'): bool
    {
        if (!static::isStringCastable($value)) {
            return false;
        }

        $searchlen = (int) mb_strlen($search, $encoding);
        $start = mb_substr((string) $value, 0, $searchlen, $encoding);

        return $search === $start;
    }
public static function startsWith ( $ value , string $ search , string $ encoding = 'UTF-8' ) : bool { if ( ! static :: isStringCastable ( $ value ) ) { return false ; } $ searchlen = ( int ) mb_strlen ( $ search , $ encoding ) ; $ start = mb_substr ( ( string ) $ value , 0 , $ searchlen , $ encoding ) ; return $ search === $ start ; }
Checks if value starts with a search string

@param mixed  $value    The value
@param string $search   The search string
@param string $encoding The string encoding

@return bool
Checks if value starts with a search string