php的file_get_content不会销毁读取到内存中的文件内容吗?
前阵子给自己写的小程序:遍历指定文件夹内的文件,并搜索指定内容
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->// 这种用法很占用内存,几乎每次都出错 $content = file_get_contents($file); // 成功 $content = ''; $fp = fopen($file, 'r'); $content .= fread($fp, 10240); // 即使没有fclose(),在函数内调用仍然会顺利运行完毕
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号