Home >Backend Development >PHP Tutorial >Solution to garbled Chinese name download in PHP_PHP Tutorial

Solution to garbled Chinese name download in PHP_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 10:54:50864browse

There are many ways to solve Chinese garbled characters. One is to encode the URL such as urlencode method, and the other is to process the following header header with binary method.

$file_name = urlencode($_REQUEST['filename']);
header("Pragma: public"); header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header('Content-Type: application/vnd.ms-excel; charset=utf-8');
header("Content-Transfer-Encoding: binary");
header('Content-Disposition: attachment; filename='.$file_name);
echo strips tutorial lashes($_REQUEST['content']);
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632295.htmlTechArticleThere are many ways to solve Chinese garbled characters. One is to encode the url such as urlencode method, and the other is as follows The header processing method is binary method. ?php tutorial $file_name = urlencod...
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