tex*_*xai 2 php string unicode utf-8 multibyte
测试字符串:
$s = "convert this: ";
$s .= "–, —, †, ‡, •, ?, ?, ?, ?, ©, ® y ™, ?, ?, ?, ?, ?, ?, ™, ?, ?, ?, ?, ?, ? ";
$s .= "but, not convert ordinary characters to entities";
Run Code Online (Sandbox Code Playgroud)
Mar*_*c B 11
$encoded = mb_convert_encoding($s, 'HTML-ENTITIES', 'UTF-8');
Run Code Online (Sandbox Code Playgroud)
假设您的输入字符串是UTF-8,这应该将大多数内容编码为数字实体.
| 归档时间: |
|
| 查看次数: |
3551 次 |
| 最近记录: |