您的位置:首页 > 其它

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: