Home >Backend Development >PHP Tutorial >为什么文件生成后是乱码?该怎么处理

为什么文件生成后是乱码?该怎么处理

WBOY
WBOYOriginal
2016-06-13 10:11:311421browse

为什么文件生成后是乱码?
写了个函数,替代相应的文字,替代完后显示的都成了???????????????????????????,??????????????,??????????????
这种乱码,是乍回事?我程序全程序编写都是用的utf-8

------解决方案--------------------
用iconv()把内容转换成utf-8,使用方法翻手册
------解决方案--------------------
你的文件是ansi编码吧. 用iconv()转化一下再写入。

Statement:
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