时时商务社区

标题: PHP中创建空文件的代码[file_put_contents vs touch] [打印本页]

作者: 网络通达    时间: 2018-2-14 08:31

            I has passed a small test to check which function is faster to create a new file.
file_put_contents vs touch
[U]复制代码[/U] 代码如下:


Average time: 0,1145s
[U]复制代码[/U] 代码如下:


Average time: 0,2322s
所以,file_put_contentstouch快,大约两倍。
            
            
您可能感兴趣的文章:
  • php file_put_contents()功能函数(集成了fopen、fwrite、fclose)
  • PHP中fwrite与file_put_contents性能测试代码
  • PHP使用内置函数file_put_contents写入文件及追加内容的方法
  • PHP中file_put_contents追加和换行的实现方法
  • PHP中危险的file_put_contents函数详解
  • PHP file_put_contents() 函数
  • [url=] PHP touch() 函数[/url]
            




    欢迎光临 时时商务社区 (http://bbs.4435.cn/) Powered by Discuz! X3.2