SyntaxStudy
Sign Up
Home PHP Reference strlen()

strlen()

function

Returns the length of a string in bytes. Use mb_strlen() for multibyte/Unicode strings.

Syntax

strlen(string $string): int

Example

php
<?php
echo strlen('Hello');       // 5
echo strlen('Hello World'); // 11
echo mb_strlen('café');     // 4