excel导出
2016-04-11 09:35
246 查看
//xls 导出
header(“Content-type:text/html;charset=utf-8”);
header(“Content-Disposition:attachment;filename=商品分类数据.xls”);
array=this->db->get(“ecs_category”)->result_array();
str=“catid\t”.“catname\t”.“keywords\t”.“catdesc\t”.“parentid\t”.“sortorder\t”.“templatefile\t”.“measureunit\t”.“showinnav\t”.“style\t”.“isshow\t”.“grade\t”.“filterattr\n”;foreach(array as k=>v) {
str.=v[‘cat_id’] . “\t” . v[′catname′]."\t".v[‘keywords’] . “\t” . v[′catdesc′]."\t".v[‘parent_id’] . “\t” . v[′sortorder′]."\t".v[‘template_file’] . “\t” . v[′measureunit′]."\t".v[‘show_in_nav’] . “\t” . v[′style′]."\t".v[‘is_show’] . “\t” . v[′grade′]."\t".v[‘filter_attr’] . “\n”;
}
echo $str;
header(“Content-type:text/html;charset=utf-8”);
header(“Content-Disposition:attachment;filename=商品分类数据.xls”);
array=this->db->get(“ecs_category”)->result_array();
str=“catid\t”.“catname\t”.“keywords\t”.“catdesc\t”.“parentid\t”.“sortorder\t”.“templatefile\t”.“measureunit\t”.“showinnav\t”.“style\t”.“isshow\t”.“grade\t”.“filterattr\n”;foreach(array as k=>v) {
str.=v[‘cat_id’] . “\t” . v[′catname′]."\t".v[‘keywords’] . “\t” . v[′catdesc′]."\t".v[‘parent_id’] . “\t” . v[′sortorder′]."\t".v[‘template_file’] . “\t” . v[′measureunit′]."\t".v[‘show_in_nav’] . “\t” . v[′style′]."\t".v[‘is_show’] . “\t” . v[′grade′]."\t".v[‘filter_attr’] . “\n”;
}
echo $str;
相关文章推荐
- 怎样设置Windows 7远程桌面连接
- PHP学习路线
- 网络地址为172.16.0.0,采用子网掩码255.255.224.0 .以下说法正确的是()
- c# datagridview表格控件常用操作
- php防止重复提交表单
- PHP模板引擎Smarty内建函数foreach,foreachelse用法分析
- (Kevin笔记四)activity相互切换的时候怎么传递和刷新数据
- excel导入
- 在唯一密钥属性“value”设置为“default.aspx”(或者index.asp等)时,无法添加类型为“add”的重复集合项
- 【剑指offer系列】 两个链表的第一个公共节点___37
- 设计模式之观察者模式
- 电商网站秒杀与抢购的系统架构
- The method getTextContent() is undefined for the type Node方法报错
- js 获取本地文件及目录方法
- swift对象
- PHP学习摘要
- JSP页面隔行换色
- Django学习总结
- Enum引发的血案,反思
- 鼠标右键多余选项删除