Home  >  Article  >  Backend Development  >  PHP's internal code conversion function mb_convert_encoding()_PHP tutorial

PHP's internal code conversion function mb_convert_encoding()_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:04:20665browse

Because a program needs to output UTF-8 encoding... but the original data is GBK encoded
Baidu found a lot of classes about internal code conversion... but there are many shortcomings. It does not support GBK TO UTF-8
However After searching one by one, I found mb_convert_encoding() in the official PHP FAQ. This function is only available in PHP 4.0.6 or above. I heard that some
would like to follow the link: http://cn.php.net/manual/zh /function.mb-convert-encoding.php
Make a GBK To UTF-8
< ?php
header("content-Type: text/html; charset=Utf-8");
echo mb_convert_encoding("

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445203.htmlTechArticleBecause a certain program needs to output UTF-8 encoding.. But the original data is GBK encoded. Baidu found a lot about it. Internal code conversion class...but it has many shortcomings. It does not support GBK TO UTF-8, but I can find them one by one...
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