Do we need to close file_get_contents?

旧巷老猫 提交于 2019-12-01 15:39:11

问题


I'm running file_get_contents() inside a loop, I see a lot of files opened in the Apache log. I don't know the reason behind it. Do we need to close the file_get_contents() function after each read?


回答1:


file_get_contents() reads a file and closes the file afterwards. It returns the read data or false, so you have no file handle to use with an fclose(), anyway.



来源:https://stackoverflow.com/questions/19650817/do-we-need-to-close-file-get-contents

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