Your Ad Here
String Function
Execute String Function Online
String Functions Online Tool

Php String Length Tutorial

 

strlen() - String Length Tutorial

The php string function strlen() counts the number of characters of a string.

int strtlen ( string $str )

The $str parameter is a string.
It returns an int which is the number of characters of $str.

 

Php String Length Example

Example: Let's count the number of characters of "HeLLo WoRlD!"

$string = "HeLLo WoRlD!";
$string_length = strlen($string);
echo $string_length;

The php string length function returns the value 12.

Test it online using our String Length Tool