Home  >  Article  >  Backend Development  >  php fiel_get_contents 输出乱码怎么处理

php fiel_get_contents 输出乱码怎么处理

WBOY
WBOYOriginal
2016-06-13 12:26:42808browse

php fiel_get_contents 输出乱码怎么办?
我设置了header("content-type='text/html',charset='utf-8'");还是返回乱码怎么办?gb2312和unicode也不行返回的图片如下: 
------解决思路----------------------
被读取的文件是什么?
你最好 echo base64_encode(file_get_contents('文件名')); 贴出来看看
------解决思路----------------------
echo  base64_encode(file_get_contents("php://input")); 
------解决思路----------------------
你的是图片文件吧。
echo base64_encode(file_get_contents($file));

打印出来看看。

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