In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces how to convert gb2312 to utf8 in php, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Php gb2312 to utf8 conversion methods: 1, open the corresponding PHP file; 2, check the original code; 3, by using preg_replace and iconv functions to convert gb2312 pages to utf8 pages.
This article operating environment: Windows7 system, PHP7.1, Dell G3 computer.
How to convert php gb2312 to utf8?
Convert PHP gb2312 pages to utf8 pages
Two functions, preg_replace and iconv, are used
$html = preg_replace ('/ charset=gb2312/', 'charset=UTF8', $html); / / $enc = mb_detect_encoding ($html); $html = iconv (' gbk', 'utf-8', $html)
Https://php.net/manual/en/function.iconv.php
Https://www.php.net/manual/en/function.preg-replace.php
Refer to the example on the official website of php
Example # 2 Using indexed arrays with preg_replace () Example # 1 iconv () example
* testurl.php
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.