RAR file reader for PHP.
- Read RAR file information
- RAR 5 archive format
- RAR 4 archive format
- No dependencies
- Very fast
Note: This package does not support extracting / unpacking rar archives.
- PHP 8.1+
The PECL RAR package is NOT required
composer require selective/rar
use Selective\Rar\RarFileReader;
use SplFileObject;
$rarFileReader = new RarFileReader();
$rarArchive = $rarFileReader->openFile(new SplFileObject('test.rar'));
foreach ($rarArchive->getEntries() as $entry) {
echo $entry->getName() . "\n";
}
use Selective\Rar\RarFileReader;
use SplTempFileObject;
$file = new SplTempFileObject();
$file->fwrite('my binary rar content');
$rarFileReader = new RarFileReader();
$rarArchive = $rarFileReader->openFile($file);
foreach ($rarArchive->getEntries() as $entry) {
echo $entry->getName() . "\n";
}
The MIT License (MIT). Please see License File for more information.