How to display file extensions, solve the problem of garbled file names after decompression, and code to transcode file names.

WBOY
Release: 2016-07-29 08:47:37
Original
1558 people have browsed it

Copy code The code is as follows:


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

The above introduces how to display the file suffix name and solve the problem of garbled file names after decompression. The code for transcoding the file name includes how to display the file suffix name. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template