php导出excel表格的简单方法有数量、大小限制吗?我想导出二十万条数据
<?phpheader("Content-Type:application/vnd.ms-excel");header("Expires:0");header("Cach...
<?php
header("Content-Type: application/vnd.ms-excel");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("content-disposition: attachment;filename=用户列表.xls");
?>
<html>
<head>
<title>用户列表</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<table class="table table-bordered table-striped">
<tr>
<th width="30%" >卡号</th>
<th width="30%" >密码</th>
</tr>
<?php foreach($query as $key=> $row){?>
<tr>
<td><?php echo $row->u_id;?></td>
<td><?php echo $row->user_pass;?></td>
</tr>
<?php }?>
</table>
</body>
</html> 展开
header("Content-Type: application/vnd.ms-excel");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("content-disposition: attachment;filename=用户列表.xls");
?>
<html>
<head>
<title>用户列表</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<table class="table table-bordered table-striped">
<tr>
<th width="30%" >卡号</th>
<th width="30%" >密码</th>
</tr>
<?php foreach($query as $key=> $row){?>
<tr>
<td><?php echo $row->u_id;?></td>
<td><?php echo $row->user_pass;?></td>
</tr>
<?php }?>
</table>
</body>
</html> 展开
1个回答
展开全部
理论上是没有,实际上要看服务器的内存大小和运算能力,,,,在导出过程中,如果时间过长,长过会话保持时间,,容易导致会话失效.
更多追问追答
追问
Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 44 bytes) in 路径
导出十万条的时候会报这个错
追答
这不是让你申请更多内存了嘛...别这样折腾啊..没几台服务器架的住这样搞的...你打开任务管理器看看,,在你导出数据的时候,,,那内存占用...
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询