Home  >  Article  >  Backend Development  >  ecshop导出excel数据

ecshop导出excel数据

WBOY
WBOYOriginal
2016-06-23 13:07:541653browse

elseif($_REQUEST['act'] == 'exec'){    $user = exec_user();    $filename = ecs_iconv(EC_CHARSET, 'GB2312', '用户信息');    header("Content-type: application/vnd.ms-excel; charset=utf-8");    header("Content-Disposition: attachment; filename=$filename.xls");    $data="会员\t省\t市\t区\t收货地址\t分区\t线路\t业务员\t业务经理\n";    foreach($user as $item)    {        $data.="$item[user_name]\t";        $data.="$item[province]\t";        $data.="$item[city]\t";        $data.="$item[district]\t";        $data.="$item[address]\t";        $data.="$item[dist_name]\t";        $data.="$item[thread_name]\t";        $data.="$item[saleman]\t";        $data.="$item[manage]\n";    }    echo ecs_iconv(EC_CHARSET, 'GB2312', $data) . "\t";    exit;}

print_r($user);出来是4千多条数据;导出却200条,为什么呢,代码有问题吗,求大神赐教,谢谢


回复讨论(解决方案)

页面有无卡死?
 给php分配的内存够不够?
打开xls文件那200行数据正常吗

找到问题了,是特殊字符造成的,谢谢

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn