php readfile错误是因为在代码中多输出了一个换行符,其解决办法:首先打开相应的PHP文件;然后删除多输出的换行符;最后重新通过readfile读取文件即可。
php入门到就业线上直播课:进入学习
Apipost = Postman + Swagger + Mock + Jmeter 超好用的API调试工具:点击使用
本文操作环境:Windows7系统、PHP7.1版,DELL G3电脑
具体问题:
php 的readfile读取文件出错?
这样打开是说图片损坏的,求解.如何解决?这样原理是为什么?
解决办法:
多输出一个换行符了
<?phpheader('Content-Type: image/jpeg');readfile('626123287.jpg');exit(0);?>
登录后复制
推荐学习:《PHP视频教程》
以上就是php readfile 错误怎么办的详细内容,更多请关注php中文网其它相关文章!