swoole_async_readfile

(PECL swoole >= 1.9.0)

swoole_async_readfileRead a file asynchronously

說明

swoole_async_readfile(string $filename, callable $callback): bool

參數

filename

The filename of the file being read.

callback
callback(string $filename, string $content): mixed
filename

The name of the file.

content

The content read from the file.

返回值

成功時返回 true, 或者在失敗時返回 false。