php 文本文件的读取效率

上传:沉默的爆发 浏览: 7 推荐: 0 文件:PDF 大小:31.96KB 上传时间:2021-02-01 16:42:57 版权申诉
首页大概3KB,是在本地测试的 复制代码 代码如下: file_get_contents(‘shadow.xml’); 耗时 0.0003 秒 复制代码 代码如下: $indexFile = fopen(‘shadow.xml’, ‘r’);while ( !feof($indexFile)) fgetc( $indexFile); 耗时 0.026 秒 复制代码 代码如下: $indexFile = fopen(‘shadow.xml’, ‘r’);fread($indexFile, 10000); 耗时 0.0003秒 相差将近 100
上传资源
用户评论