当前位置:网站首页>TP5 spreadsheet excel table export
TP5 spreadsheet excel table export
2022-06-27 02:39:00 【Xiaobai's Iraqi】
/**
* Export for all users Excel form
*/
public function daochuexcle(){
$arrays_list= (
[0] => Array
(
[user_id] => 19
[user_knapsack_id] => 232
[grade] => 2
[type] => card
[upgrade_gc] => 100
[desc] =>
[upgrade_time] => 1642834756
)
[1] => Array
(
[user_id] => 19
[user_knapsack_id] => 232
[grade] => 3
[type] => card
[upgrade_gc] => 2
[desc] =>
[upgrade_time] => 1642834772
)
[2] => Array
(
[user_id] => 17
[user_knapsack_id] => 232
[grade] => 3
[type] => card
[upgrade_gc] => 50
[desc] =>
[upgrade_time] => 1642834772
)
)
// print_r($arrays_list);
$spreadsheet = new Spreadsheet();
# Get active workbook
$sheet = $spreadsheet->getActiveSheet();
// Batch assignment
$sheet->setCellValue('A1','ID');
$sheet->setCellValue('B1',' User Backpack ID');
$sheet->setCellValue('C1',' User level ');
$sheet->setCellValue('D1',' type ');
$sheet->setCellValue('E1',' Points available to users ');
$sheet->setCellValue('F1',' Membership level ');
$sheet->setCellValue('G1','xxxx');
$sheet->setCellValue('H1',' Time ');
//$sheet->fromArray(
$arrays_list,
3,
'A2'
);
# Xlsx class Save spreadsheet to file
$writer = new Xlsx($spreadsheet);
$writer->save('1.xlsx');
// Client file download
header('Content-Type:application/vnd.ms-excel');
header('Content-Disposition:attachment;filename=1.xls');
header('Cache-Control:max-age=0');
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls');
$writer->save('php://output');
return $this->renderSuccess('',' complete ');
}
边栏推荐
- Oracle/PLSQL: Replace Function
- 学习太极创客 — MQTT(八)ESP8266订阅MQTT主题
- Lodash get JS code implementation
- Brief introduction of 228 dropout methods of pytorch and fast implementation of dropblock with 4 lines of code based on dropout
- Look! In June, 2022, the programming language ranking list was released! The first place is awesome
- ConstraintLayout(约束布局)开发指南
- TechSmith Camtasia最新2022版详细功能讲解下载
- Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
- Learn Tai Chi Maker - mqtt Chapter 2 (3) reserved messages
- Dameng database installation
猜你喜欢

h5液体动画js特效代码

P5.js death planet

Learning Tai Chi Maker - mqtt Chapter 2 (II) esp8266 QoS application

Mmdetection uses yolox to train its own coco data set

谷歌开始卷自己,AI架构Pathways加持,推出200亿生成模型

Flink学习4:flink技术栈

Constraintlayout Development Guide

Docker deploy redis cluster
![[array] sword finger offer II 012 The sum of left and right subarrays is equal | sword finger offer II 013 Sum of two dimensional submatrix](/img/e4/7bae2a109dcf5e2a8f032e73b89479.png)
[array] sword finger offer II 012 The sum of left and right subarrays is equal | sword finger offer II 013 Sum of two dimensional submatrix

TechSmith Camtasia最新2022版详细功能讲解下载
随机推荐
Learn Tai Chi Maker - mqtt (VIII) esp8266 subscribe to mqtt topic
1、项目准备与新建
Cs5213 HDMI to VGA (with audio) single turn scheme, cs5213 HDMI to VGA (with audio) IC
The use and introduction of pytorch 23 hook and the implementation of plug and play dropblock based on hook
平均风向风速计算(单位矢量法)
学习太极创客 — MQTT 第二章(三)保留消息
Oracle/PLSQL: Lower Function
Press key to control LED status reversal
Don't be brainwashed. This is the truth about the wages of 90% of Chinese people
Oracle/PLSQL: Replace Function
Learn Tai Chi Maker - mqtt Chapter 2 (3) reserved messages
How to solve the problem of low applet utilization
对数器
学习太极创客 — MQTT(六)ESP8266 发布 MQTT 消息
学习太极创客 — MQTT(九)ESP8266 同时订阅和发布 MQTT 消息
【数组】剑指 Offer II 012. 左右两边子数组的和相等 | 剑指 Offer II 013. 二维子矩阵的和
2022中式面点师(高级)复训题库及在线模拟考试
Yalm 100b: 100billion parameter open source large model from yandex, Russia, allowing commercial use
pytorch 23 hook的使用与介绍 及基于hook实现即插即用的DropBlock
Calculation of average wind direction and speed (unit vector method)