PHP readfile adds content length to output

让人想犯罪 __ 提交于 2020-07-08 09:31:42

问题


I am using the PHP readfile function to read a file and print it like so: print readfile ('anyfile'). This works, but the content length of the file is added at the end of the string also. Why?


回答1:


readfile() prints out the contents itself and returns the content length -- you're effectively printing the contents with readfile and then printing the content length with print. Remove print and just use

readfile('anyfile');


来源:https://stackoverflow.com/questions/2733188/php-readfile-adds-content-length-to-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!