PHP code example of likeajohny / php-fs

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

    

likeajohny / php-fs example snippets


PhpFs\File::create('./filepath/cool-story-bro.txt');

PhpFs\File::write('./filepath/cool-story-bro.txt', 'Let me tell you a story!');

PhpFs\File::append('./filepath/cool-story-bro.txt', "\nAnd the story goes as follows:");

PhpFs\File::prepend('./filepath/cool-story-bro.txt', "The stories foreword\n");

PhpFs\Directory::remove('./path/to/directory');

PhpFs\Directory::empty('./path/to/directory');