定义和用法

strlen() 函数返回字符串的长度。

语法

strlen(string)

参数 描述
string 必需。规定要检查的字符串。

例子

<?php echo strlen("Hello world!"); ?>

输出:

12