PHP code example of phasync / file-streamwrapper

1. Go to this page and download the library: Download phasync/file-streamwrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phasync / file-streamwrapper example snippets




ample usage within phasync coroutine framework
phasync::run(function() {
    phasync::go(function() {
        $data = file_get_contents("some-path");
        // Handle the data
        echo "Data from some-path: " . $data . PHP_EOL;
    });

    phasync::go(function() {
        $data = file_get_contents("other-path");
        // Handle the data
        echo "Data from other-path: " . $data . PHP_EOL;
    });
});