PHP code example of amphp / file

1. Go to this page and download the library: Download amphp/file 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/ */

    

amphp / file example snippets


$contents = Amp\File\read('/path/to/file.txt');

Amp\File\write('/path/to/file.txt', 'contents');

$file = Amp\File\openFile('/path/to/file.txt', 'r');
Amp\ByteStream\pipe($file, getStdout());



use Amp\File;

tus(__FILE__));
plain
array(13) {
  ["dev"]=>
  int(16777232)
  ["ino"]=>
  int(15186622)
  ["mode"]=>
  int(33188)
  ["nlink"]=>
  int(1)
  ["uid"]=>
  int(501)
  ["gid"]=>
  int(20)
  ["rdev"]=>
  int(0)
  ["size"]=>
  int(104)
  ["blksize"]=>
  int(4096)
  ["blocks"]=>
  int(8)
  ["atime"]=>
  int(1692381227)
  ["mtime"]=>
  int(1692381226)
  ["ctime"]=>
  int(1692381226)
}