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;
是不是阿里云哪里有配置或需要开通服务?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。