Home  >  Q&A  >  body text

请问如何对一个字符串进行转码?

这是啥这是啥2747 days ago811

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-10-01 00:52:39

    How to transcode a string? -PHP Chinese website Q&A-How to transcode a string? -PHP Chinese website Q&A

    Let’s take a look and learn.

    reply
    0
  • 怪我咯

    怪我咯2017-03-15 17:44:25

    使用php的iconv函数,签名为: 
    $str=iconv(fromEncode,toEncode,str); 
    例如: 
    $str="php字符串转码"; 
    $str=iconv("utf-8","gbk",$str);//将字符串从utf-8格式转换为gbk格式 
    转码是很重要的一个问题,例如目前许多博客提供的rss都是utf-8返回的,因此需要通过转化才能正确显示。

    reply
    0
  • Cancelreply