久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php怎么把json unicode轉(zhuǎn)中文

      php把json unicode轉(zhuǎn)中文的方法:1、使用“json_encode($log['result_data'],JSON_UNESCAPED_UNICODE);”方法進(jìn)行轉(zhuǎn)換;2、使用“function unicodeDecode($unicode_str){…}”方法進(jìn)行轉(zhuǎn)換即可。

      php怎么把json unicode轉(zhuǎn)中文

      本教程操作環(huán)境:Windows10系統(tǒng)、PHP8.1版、DELL G3電腦

      php怎么把json unicode轉(zhuǎn)中文?

      PHP把unicode編碼的json字符串轉(zhuǎn)中文

      json中中文被編碼

      $s = '[{"param_name":"email","param_caption":"u90aeu7bb1","operator":"u5305u542b","value":"aaaau5927u592bu6492"}]';
      登錄后復(fù)制

      將中文編碼轉(zhuǎn)成中文

      方法1.

      json_encode($log['result_data'],JSON_UNESCAPED_UNICODE);
      登錄后復(fù)制

      方法2.

         /**      * 把unicode編碼的字符串轉(zhuǎn)為人眼可看的字符串      * @param $unicode_str      *      * @return string      */     function unicodeDecode($unicode_str){         $unicode_str = str_replace('"', '"', $unicode_str);         $unicode_str = str_replace("'", "'", $unicode_str);         $json = '{"str":"'.$unicode_str.'"}';           $arr = json_decode($json,true);           if(empty($arr)){             return '';         }           return $arr['str'];     }
      登錄后復(fù)制

      結(jié)果:

      [{"param_name":"email","param_caption":"郵箱","operator":"包含","value":"aaaa大夫撒"}]
      登錄后復(fù)制

      推薦學(xué)習(xí):《PHP視頻教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號