在PHP中,可以使用内置函数strlen()
来统计字符串的长度。示例如下:
$string = "Hello, World!";
$length = strlen($string);
echo "Length of the string: " . $length;
这段代码将输出:Length of the string: 13
,表示字符串"Hello, World!"的长度为13个字符。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:php怎么取字符串长度