Swoole\Coroutine\System::readFile(string $filename)

Declaration

<?php
Swoole\Coroutine\System::readFile(string $filename)

Parameters

filename

file location

Return

content

the content of a file

Description

Alias: Swoole\Coroutine\System::readFile.

Read the content of a file.

Example

<?php
Co\run(function () use ($filename) {
    $filename = __DIR__ . "/test.txt";
    $r =  co\System::readFile($filename);
    var_dump($r);
});