Home > php教程 > php手册 > 解决文件名解压后乱码的问题 将文件名进行转码的代码

解决文件名解压后乱码的问题 将文件名进行转码的代码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:03:30
Original
1362 people have browsed it

复制代码 代码如下:


$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 "$fz\t$fn\n";
zip_entry_close($e);
}
zip_close($a);
?>

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template