phasync\file_put_contents() function

Documentation

Coroutine aware write of data to a file.

This function is modeled after file_put_contents(), but it performs the write operation in a non-blocking manner using the event loop.

Signature

function file_put_contents(string $filename, mixed $data, int $flags = 0): int|false

Parameters

NameTypeDefault
$filename string required
$data mixed required
$flags int 0

Returns

int|false

Source

src/functions.php:116-119