mb_strlen

(PHP 4 >= 4.0.6, PHP 5, PHP 7)

mb_strlenGet string length

Descrição

mb_strlen ( string $string [, string|null $encoding = null ] ) : int

Gets the length of a string.

Parâmetros

string

The string being checked for length.

encoding

O parâmetro encoding é a codificação de caractere. Se ele é omitido, o valor da codificação de caractere interna é usado.

Valor Retornado

Returns the number of characters in string string having character encoding encoding. A multi-byte character is counted as 1.

Erros

If the encoding is unknown, an error of level E_WARNING is generated.

Changelog

Versão Descrição
8.0.0 encoding is nullable now.

Veja Também