PHP strlen() function

The strlen() function return the lengrh of string


strlen( string $string ) : int


Parameter Name Descrption
$string Required, The input string.

Return Value

Return the length of the string, if the string is empty then 0.

strlen() examples

echo strlen('PHP String Length'); 

echo strlen(' String ');  

Related Functions

  • count(): Count all elements in an array, or something in an object