PHP reads the file content through fread(). How to solve the problem of garbled Chinese characters?
我想大声告诉你
我想大声告诉你 2017-05-16 13:10:49
0
2
1477

In PHP, files are read directly through the fread function. If the file content encounters Chinese characters, the problem will be garbled. How to solve this problem?

我想大声告诉你
我想大声告诉你

reply all(2)
phpcn_u1582

Try transcoding the content after reading it

iconv('gbk', 'utf-8', $data)
黄舟

That’s because the encoding of your output page is inconsistent with the encoding of the file being read

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template