PHP转码函数mb_convert_encoding() 和iconv()

PHP转码函数mb_convert_encoding() 和iconv() 

注意:函数mb_convert_encoding的执行效率比iconv差,且需开启php的mbstring扩展

一般情况下使用iconv,但此函数在碰到无法转码字符会丢弃,此种情况下可以用mb_convert_encoding()。

实例:导出excel时,需从utf-8转换为GBK,此时若使用iconv()碰到繁体字会丢弃,导致导出文件内容不完整。

 

相关文章:

  • 2021-06-06
  • 2022-02-08
  • 2021-12-11
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-06-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
相关资源
相似解决方案