PHP code example of vzaica / extractor
1. Go to this page and download the library: Download vzaica/extractor 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/ */
vzaica / extractor example snippets
bash
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar update
php
use Symfony\Component\Finder\Finder;
use Mmoreram\Extractor\Filesystem\TemporaryDirectory;
use Mmoreram\Extractor\Resolver\ExtensionResolver;
use Mmoreram\Extractor\Extractor;
$temporaryDirectory = new TemporaryDirectory();
$extensionResolver = new ExtensionResolver;
$extractor = new Extractor(
$temporaryDirectory,
$extensionResolver
);
/**
* @var Finder $files
*/
$files = $extractor->extractFromFile('/tmp/myfile.rar');
foreach ($files as $file) {
echo $file->getRealpath() . PHP_EOL;
}