PHP code example of phant / file

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

    

phant / file example snippets


use Phant\File\File;

$file = new File('path/filename.ext');

$filePath = $file->getPath();

$fileExist = $file->exist();

$file->delete();

$temoraryDirectory = $file->getTemoraryDirectory();

$cleanFilename = File::cleanFilename($dirtyFilename);

$file = File::download($fileUrl);

use Phant\File\Csv;

$file = new File('path/filename.csv');

$isConform = $file->verifyColumns($columns);

$nbLines = $file->getNbLines();

foreach ($file->readFileByLine() as $line) {
	
}

use Phant\File\Zip;

$file = new File('path/filename.zip');

$files = $file->unarchive();
foreach ($files as $file) {
}