header("Content-type:text/csv");
header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
header('Expires:0');
header('Pragma:public');
header("Content-Disposition:filename=".'produ'.'.csv');
$file = fopen("php://output", "w");
fwrite($file, chr(0xEF).chr(0xBB).chr(0xBF));
fputcsv($fi,['field','command','name']);
foreach ($arr as $item)
{
fputcsv($fi,$item);
}
ini_set('memory_limit','1024M'); //设置程序运行的内存
ini_set('max_execution_time',0); //设置程序的执行时间,0为无上限
ini_set("pcre.backtrack_limit" , -1);
ini_set("pcre.recursion_limit" , -1);
header('Access-Control-Allow-Origin:*');//允许所有来源访问
//ob_end_clean(); //清除内存
//ob_start();
header("Content-Type: text/csv");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition:filename=".'导出记录'.'.csv');
$fp=fopen('php://output','w');
fwrite($fp, chr(0xEF).chr(0xBB).chr(0xBF));