read()

This static function helps you read or retrieve results from the website you specify. The input parameter is a string type.

/**
 * @throws Throwable
 *
 * Use this to read a file or url.
 */
public static function read(string $path) : Promise;

Example:

Stream::read("https://www.google.com/")
->then(function($result) {
    var_dump($result);
});

Stream::read("C:\Users\Nam\Desktop\GithubPage\Example.txt")
->then(function($result) {
    var_dump($result);
});

Last updated