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?
phpcn_u15822017-05-16 13:12:49
Try transcoding the content after reading it
iconv('gbk', 'utf-8', $data)
黄舟2017-05-16 13:12:49
That’s because the encoding of your output page is inconsistent with the encoding of the file being read