swoole_异步文件读取与写入

//读取文件
Swoole\Async::readfile(__DIR__."/1.txt", function ($filename, $fileContent){
    echo "filename:" . $filename . PHP_EOL;
    echo "content:" . $fileContent . PHP_EOL;
});

echo "end";
$content = date();
swoole_async_writefile(__DIR__ . "/1.txt", $content, function ($filename){
    // todo
    echo "success";
});

echo "end";
本作品采用《CC 协议》,转载必须注明作者和本文链接
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!