准备工作:
使用VMware软件安装Centos7 安装php7 和swoole扩展
<?php
//异步写入文件
swoole_async_writefile("test.log","我想你",function ($file_name){
echo $file_name;
},FILE_APPEND);
官方文档:
https://wiki.swoole.com/wiki/page/185.html
执行效果
准备工作:
使用VMware软件安装Centos7 安装php7 和swoole扩展
<?php
//异步写入文件
swoole_async_writefile("test.log","我想你",function ($file_name){
echo $file_name;
},FILE_APPEND);
官方文档:
https://wiki.swoole.com/wiki/page/185.html
执行效果