Home > Backend Development > PHP Tutorial > 中文字符串取下标转换整数的有关问题

中文字符串取下标转换整数的有关问题

WBOY
Release: 2016-06-13 12:41:39
Original
839 people have browsed it

中文字符串取下标转换整数的问题
已知php文件是utf8编码,现有如下内容:
$data = "中";
为什么(int)substr($data, 0, 1) == 0?
如何能转换成正确的整数?

PHP 编码 UTF-8
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template