Menu Home

strlen

osbo.com | PHP | Functions | strlen

Get string length

Syntax

strlen ( string $string ) : int

Parameters

string

The string being measured for length.

Return

The length of the string on success, and 0 if the string is empty.

Examples

<?

$string = 'Hello World!';

$return = strlen($string);

echo $return;

?>
12

PHP