本文实例讲述了PHP Swoole异步读取、写入文件操作。分享给大家供大家参考,具体如下:
异步读取文件:swoole_async_readfile
异步写入文件:swoole_async_writefile
【示例】
读取文件 readfile.php:
1 2 3 4 5 6 |
|
执行结果:
写入文件 writefile.php:
1 2 3 4 5 6 7 8 |
|
执行结果:
1.txt:
(说明:以上两个函数可读取最大文件为4M,读取大文件使用 swoole_async_read、swoole_async_write)
版权声明:本文为a8228560原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。

正在上传…