PHP Convert Windows-1251 to UTF 8

前端 未结 5 673
粉色の甜心
粉色の甜心 2021-01-04 10:03

I have a small html code and I need to convert it to UTF-8.
I use this iconv(\"windows-1251\", \"utf-8\", $html);

All text converts correctly, but

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-04 10:50

    If you have access to the Multibye package, you can try it. See the PHP page here: http://www.php.net/manual/en/function.mb-convert-encoding.php

    $html_utf8 = mb_convert_encoding($html, "utf-8", "windows-1251");
    

提交回复
热议问题