In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you php shows how to deal with traditional garbled code, I hope you have something to gain after reading this article, let's discuss it together!
Php display traditional garbled solutions: 1, open the corresponding PHP code file; 2, through the "mb_convert_encoding ($str,'gbk','utf-8');" way to solve the problem of garbled display of traditional characters in the web interface.
This article operating environment: Windows7 system, PHP7.1 version, DELL G3 computer
What if php displays traditional garbled codes?
Php: a function to solve the garbled display of simplified and traditional characters in the web interface
Simplified and traditional Chinese characters are the solutions to display garbled in the web interface:
Mb_convert_encoding ($str,'gbk','utf-8')
Gbk is a traditional code and gb2312 is a simplified code. However, gbk contains gb2312, so if the array contains traditional and simplified characters, you can use the gbk transformation.
Related introduction:
The mb_convert_encoding function is a multi-byte string encoding conversion function within php, which can be converted when necessary, such as solving the problem of garbled Chinese characters caused by using Ajax in the GB2312 coding environment. Almost all encodings are supported, and the version supports PHP 4 > = 4.0.6 and PHP 5.
Syntax:
Mb_convert_encoding (string str, string to_encoding [, mixed from_encoding])
The string that string str needs to transcode
String to_encoding specifies the conversion to some kind of encoding, such as gb2312, gbk, utf-8, etc.
After reading this article, I believe you have a certain understanding of "how to deal with traditional garbled codes in php display". If you want to know more about it, welcome to follow the industry information channel. Thank you for your reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.