php导出utf8 csv解决打开乱码问题

private function export_csv($filename,$data) {
        header("Content-type:text/csv");
        header("Content-Disposition:attachment;filename=".$filename);
        header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
        header('Expires:0');
        header('Pragma:public');
        echo chr(239).chr(187).chr(191);
        echo $data;
    }

Leave a Comment

电子邮件地址不会被公开。 必填项已用*标注