PHP code example of kherge / file-manager

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

    

kherge / file-manager example snippets


use KHerGe\File\File;

// Create a new file manager.
$file = new File('example.txt', 'r');

// Iterate through the contents of the file.
foreach ($file->iterate() as $buffer) {
    // ...
}

use KHerGe\File\File;
use KHerGe\File\Memory;
use KHerGe\File\Stream;

// Create a manager for a file.
$manager = new File('example.txt', 'r');

// Create a manager for a string.
$manager = new Memory('example contents', false);

// Create a manager for a file stream.
$manager = new Stream($stream);