Home > Backend Development > PHP Problem > What to do if php fread is garbled?

What to do if php fread is garbled?

藏色散人
Release: 2023-03-06 10:22:02
Original
2265 people have browsed it

php fread garbled solution: first read the file directly through the fread function; then transcode the read content through the "iconv('gbk', 'utf-8', $data)" method That’s it.

What to do if php fread is garbled?

Recommendation: "PHP Video Tutorial"

In php, read the file directly through the fread function, and the file content If you encounter Chinese, garbled characters will appear. How to solve this problem?

Solution:

Try transcoding the content after reading it out

iconv('gbk', 'utf-8', $data)
Copy after login

The above is the detailed content of What to do if php fread is garbled?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template