How to obtain the HTML entity numbers corresponding to characters (including text)

Source: Internet
Author: User
How can I obtain the HTML entity numbers corresponding to characters (including text)? how can PHP obtain the HTML entity numbers corresponding to characters (including text), as shown in
Number 3 corresponds to 3


Reply to discussion (solution)

$ S = 'Excuse me, how does PHP obtain the HTML entity number corresponding to characters (including text), for example, number 3 corresponds to 3'; echo '&#'. join ('; & #', unpack ('C * ', $ s )). ';';
C. copyright £ ;*****************************************************************©Please refer to ~~ózäzähtml {μ {±?

Note the differences between character sets

No, it should be unified into unicode encoding

$ S = iconv ('gbk', 'ucs-2', 'how does PHP obtain the HTML entity numbers corresponding to characters (including text, for example, number 3 corresponds to 3 '); echo '&#'. join ('; & #', unpack ('n' * ', $ s )). ';';
How does PHP obtain the HTML entity numbers corresponding to characters (including text), for example, 3 corresponds to 3

No, it should be unified into unicode encoding

$ S = iconv ('gbk', 'ucs-2', 'how does PHP obtain the HTML entity numbers corresponding to characters (including text, for example, number 3 corresponds to 3 '); echo '&#'. join ('; & #', unpack ('n' * ', $ s )). ';';
How does PHP obtain the HTML entity numbers corresponding to characters (including text), for example, 3 corresponds to 3


Why is UNICODE encoded in a unified manner? will the selection of language families on my page be affected?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.