I am wondering if PHP can extract the *.7z extension. I have searched a lot about it and I all what I see is *.zip, *.rar etc... but not 7z. Here is the code that I have tried. ZipArchive();
is not supporting 7z.
$zip = new ZipArchive();
$x = $zip->open($target_path); //I have tried ,ZipArchive::CREATE|ZipArchive::OVERWRITE after path but no luck.
if($x === true) {
$zip->extractTo('../uploads/ext');
$zip->close();
echo "Your zip file has been unpacked.";
}
else
{
echo 'not unpacked!';
}
I have many 7z files and I am looking to let PHP unpack them to get information from them. I have looked at 7zip website for some resources but no luck. Its looks like ZipArchive();
cannot open *.7z
Does anyone have any idea about this?
I need to unzip 7z extension by PHP.