/** *下载csv数据 *@param $array数据 *@param $file */ function down_csv($array,$file){ set_time_limit(0); $str=''; foreach ($array as $k3=>$v3){ $string=''; foreach ($v3 as $k=>$v){ $string.=$string==""?''.$v:','.''.$v; } $str.= "$string "; } $str=mb_convert_encoding($str, "GBK", "UTF-8"); $re=file_put_contents('./'.$file,"$str"); header("Content-type:application/vnd.ms-execl;charset=gb2312"); header('location:/'.$file);exit; }
08-05
3801
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-05
933
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)