亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長(zhǎng)資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    php字符串如何轉(zhuǎn)utf8編碼

    php字符串轉(zhuǎn)utf8編碼的方法:首先使用“mb_detect_encoding”方法自動(dòng)識(shí)別字符串編碼;然后通過(guò)“mb_convert_encoding”函數(shù)將其轉(zhuǎn)換成國(guó)際標(biāo)準(zhǔn)編碼“utf-8”即可。

    php字符串如何轉(zhuǎn)utf8編碼

    推薦:《PHP視頻教程》

    在使用mb_convert_encoding時(shí)要先知道字符編碼,如果編碼錯(cuò)誤就會(huì)亂碼,使用mb_detect_encoding自動(dòng)識(shí)別字符串編碼,并轉(zhuǎn)換成國(guó)際標(biāo)準(zhǔn)編碼utf-8編碼。

    <?php $encode = mb_detect_encoding($str, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5','LATIN1')); if($encode != 'UTF-8'){     $name = mb_convert_encoding($name, 'UTF-8', $encode); }

    mb_convert_encoding — 轉(zhuǎn)換字符的編碼

    mb_detect_encoding — 檢測(cè)字符的編碼

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