Home > Backend Development > PHP Tutorial > 怎么获取字符(包含文字)所对应的HTML实体编号

怎么获取字符(包含文字)所对应的HTML实体编号

WBOY
Release: 2016-06-13 12:14:46
Original
1109 people have browsed it

如何获取字符(包含文字)所对应的HTML实体编号
请问,PHP如何获取字符(包含文字)所对应的HTML实体编号,如
数字3对应的是3

------解决思路----------------------
不对,应该统一化为 unicode 编码

$s = iconv('gbk', 'ucs-2', '请问,PHP如何获取字符(包含文字)所对应的HTML实体编号,如 数字3对应的是3');<br />echo '&#' . join(';&#', unpack('n*', $s)) . ';';<br />
Copy after login
请问,PHP如何获取字符(包含文字)所对应的HTML实体编号,如 数字3对应的是3

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