Home  >  Article  >  Backend Development  >  php mb_convert_encoding text encoding conversion function

php mb_convert_encoding text encoding conversion function

WBOY
WBOYOriginal
2016-07-25 08:53:41883browse
  1. $str='Scripting School: http://bbs.it-home.org';

  2. echo mb_convert_encoding($str, "utf-8"); / /Encoding to utf-8

  3. $str='Programmer's Home: http://bbs.it-home.org';

  4. echo mb_convert_encoding($str, "utf-8" , "gbk"); //The original encoding is known to be gbk, converted to utf-8

  5. $str='Programmer's Home: http://bbs.it-home.org' ;

  6. echo mb_convert_encoding($str, "utf-8", "auto"); //Unknown original encoding, after automatic detection by auto, convert the encoding to utf-8
  7. ?>

Copy code


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