PHP code example of philasearch / io

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

    

philasearch / io example snippets



use Philasearch\IO\Directory as Directory;
use Philasearch\IO\File      as File;

$dir = new Directory( '/path/to/directory' );

$files = $dir->getFiles(); // returns an array of files

foreach ( $files as $file )
{
    $file->readFile();  // returns the file contents as a string
    $file->getPath();   // returns the file path
    $file->getName();   // returns the file name