Home >Backend Development >PHP Tutorial >Solution to garbled Chinese name download in PHP_PHP Tutorial
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']);
?>