<?php
Swoole\Coroutine\System::writeFile(string $filename, string $content, int $flags)
the location of a file.
the content to be written to the file.
FILE_APPEND
Coroutine ID.
Alias: Swoole\Coroutine::writeFile
.
Write content into a file.
Maximum size of $fileContent
is 4MB.
$flags
should be FILE_APPEND
if appending to the file.
<?php
Co\run(function() {
$filename = __DIR__ . "/test.txt";
$r = co\System::writeFile($filename, "hello\n");
var_dump($r);
});