excel导出

来源:互联网 发布:设计顺序表的逆置算法 编辑:程序博客网 时间:2024/05/16 14:25

//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;

0 0