V
V
Vladimir2019-04-01 14:47:12
PHP
Vladimir, 2019-04-01 14:47:12

How to unpack the data contained in a php variable using ZipArchive?

Good day everyone, I need your help, how to unpack the data contained in the variable xlsx data using ZipArchive or the Zip Function.
It is very important from the variable , do not pass the path

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
coderisimo, 2019-04-01
@coderisimo

try like this :

file_put_contents('php://memory', $text); // $text - это переменная с текстом зипа
$zip = new ZipArchive;
$res = $zip->open('php://memory'));
if ($res === TRUE) {
  // распаковываем файл куда надо , $path -  путь
  $zip->extractTo($path);
  $zip->close();
}

but there may be nuances

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question