Home >Backend Development >PHP Tutorial >HTML-ENTITIES encoding
When using fabpot/goutte (https://github.com/FriendsOfPHP/Goutte) to crawl the web page, I found that no matter what encoding the target page is (gb2312...), the final result is unicode.
After research, I found that Symfony’s crawler calls html-entities encoding.
mb_convert_encoding($content, 'HTML-ENTITIES', $charset);
Reference
A numeric character reference in HTML refers to a character by its Universal Character Set/Unicode code point
The above introduces HTML-ENTITIES coding, including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.