Home  >  Article  >  Backend Development  >  Solve the problem of garbled file names after decompression. Code to transcode file names_PHP tutorial

Solve the problem of garbled file names after decompression. Code to transcode file names_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:21:581140browse

复制代码 代码如下:

$a=zip_open('other.zip');
while ($e=zip_read($a)){
$fz = zip_entry_filesize($e);
$fn = iconv('GBK','UTF-8',zip_entry_name($e));
if (!$fz){//dir
mkdir($fn);
continue;
}
if (!zip_entry_open($a, $e))
continue;
file_put_contents($fn, zip_entry_read($e, $fz));
echo "$fzt$fnn";
zip_entry_close($e);
}
zip_close($a);
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/324764.htmlTechArticle复制代码 代码如下: ?php $a=zip_open('other.zip'); while ($e=zip_read($a)){ $fz = zip_entry_filesize($e); $fn = iconv('GBK','UTF-8',zip_entry_name($e)); if (!$fz){//dir mkdi...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn