* 1.strlen($str)
* 2.mb_strlen($str, $encoding)
$siteName = 'php中文网';
//Get the internal character encoding set
$encoding = mb_internal_encoding(); echo '内部字符编码集: ',$encoding,'<br>';
/ /1.strlen($str): Get the string length represented by bytes
//In utf8 mode, a Chinese character is represented by three bytes
echo strlen($siteName),'<br>';
//2.mb_strlen ($str, $encoding): Get the length represented by the number of characters
echo mb_strlen($siteName, $encoding),'<br>';
//Omit the second parameter, the system default character encoding set will be used, which is currently utf-8
echo mb_strlen($siteName),'<br>'; //返回值不变

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

WebStorm Mac version
Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Mac version
God-level code editing software (SublimeText3)