Home >Backend Development >PHP Tutorial >Implementation of utf8 encoding in php

Implementation of utf8 encoding in php

WBOY
WBOYOriginal
2016-07-06 13:52:30960browse

As shown below, I am looking for an implementation method. I have searched in many places, but the encoding is wrong. The code itself is utf8 encoded. How to implement utf8 encoding of strings? ? ?
Implementation of utf8 encoding in php

Reply content:

As shown below, I am looking for an implementation method. I have searched in many places, but the encoding is wrong. The code itself is utf8 encoded. How to implement utf8 encoding of strings? ? ?
Implementation of utf8 encoding in php

The htmlentities function converts characters into HTML entities
html_entity_decode converts HTML entities back into characters
echo html_entity_decode('哈');//ha

The UTF-8 conversion in chinaz is wrong, it is actually unicode

This can be done like this. You enter the Chinese characters you want to convert in the Baidu input box, then search, copy the URL of the current address box, and paste it into the text document. What follows wd is the UTF-8 encoding of the Chinese characters. Each byte is separated by %, and general Chinese characters are encoded in 3 bytes.

Statement:
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