0

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);

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.

Does anyone have any idea about this?

I'm using windows server 2012.

I hope that I explained it right. Thank you.

Profile
  • 23
  • 1
  • 7

0 Answers0