PHP >= 8.1
composer require phant/file
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) {
}