开发者社区> 问答> 正文

本地测试没有问题上传服务器后,在导出execl表时,直接将内容打印到了页面上,而没有生成execl

image.png header("Content-Type:content=text/html;charset=utf-8"); header("Content-type:application/vnd.ms-excel"); header("Content-Disposition:filename=xls_region.xls"); header("Pragma: no-cache"); header("Expires: 0"); /设置表格信息/ $str=""; $str2=""; $str.= "id"."\t"; $str.= "姓名"."\t"; $str.= "职位"."\t"; $str.= "单位"."\t"; $str.= "单位所在地"."\t"; $str.= "手机号"."\t"; $str.= "身份证"."\t\r\n"; $info = iconv("UTF-8","GBK",$str); echo $info; $result = mysqli_query($conn,$sql); while($row = mysqli_fetch_assoc($result)){ $list[] = $row; } mysqli_free_result($result); mysqli_close($conn); $co = 1; foreach($list as $v){ $str2.= trim($co++)."\t"; $str2.= trim(iconv("UTF-8","GBK","\t".$v['name']."\t"))."\t"; $str2.= trim(iconv("UTF-8","GBK",$v['danwei']))."\t"; $str2.= trim(iconv("UTF-8","GBK",$v['zhiwei']))."\t"; $str2.= trim(iconv("UTF-8","GBK",$v['szd']))."\t"; $str2.= trim(iconv("UTF-8","GBK","'".$v['phone']))."\t"; $str2.= trim(iconv("UTF-8","GBK","'".$v['sfz']))."\t\r\n"; } echo $str2;

是不是阿里云哪里有配置或需要开通服务?

展开
收起
李梦寒 2022-10-20 21:35:18 409 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS计算与存储分离架构实践 立即下载