> 讀取表格數據示例
~~~
use PhpOffice\PhpSpreadsheet\IOFactory;
// 創建讀操作
$reader = IOFactory::createReader('Xlsx');
// 打開文件 載入excel表格
$spreadsheet = $reader->load($_FILES['excel']['tmp_name']);
// 獲取活動工作簿
$sheet = $spreadsheet->getActiveSheet();
// 獲取內容的最大列 如 D
$highest = $sheet->getHighestColumn();
// 獲取內容的最大行 如 4
$row = $sheet->getHighestRow();
// 用于存儲表格數據
$data = [];
for ($i = 2; $i <= $row; $i++) {
// D 1234 C 123
$t1 = $sheet->getCellByColumnAndRow(1, $i)->getValue();
$t2 = $sheet->getCellByColumnAndRow(2, $i)->getValue();
$t3 = $sheet->getCellByColumnAndRow(3, $i)->getValue();
$t4 = $sheet->getCellByColumnAndRow(4, $i)->getValue();
$data[] = [$t1, $t2, $t3, $t4];
}
var_dump($data);
~~~
- 搭建ThinkPHP6的開發環境
- 配置ThinkPHP6
- 必要的基礎知識(basic)
- MVC開發模式
- 控制器(controller)
- 數據庫(database)
- 模型(model)
- 模型關聯(relation)
- 視圖(view)
- Session
- Cookie
- 緩存(cache)
- 上傳(upload)
- 驗證器(validate)
- 驗證碼(captcha)
- 命令行(command)
- 服務器部署(deploy)
- 數據備份(backup)
- 數據同步(synchronization)
- 訂閱服務(subscribe)
- PHP 易混淆知識點
- 助手函數
- MySQL規范
- Redis 規范
- office插件 phpoffice
- 拼音插件 pinyin
- 日期插件 datetime
- 消息插件 amqp
- 產品部署環境的搭建
- PDF 等雜項處理
- 文件上傳
- 常用擴展
- flc/dysms
- 使用示例 ①
- 使用示例 ②
- qiniu/php-sdk
- 簡介
- 使用示例
- 使用示例 2 ②
- liliuwei/thinkphp-jump
- 擴展介紹
- 下載擴展
- 使用方法
- topthink/think-captcha
- 安裝擴展
- 驗證碼顯示
- 更換驗證碼
- 驗證碼校驗
- 驗證碼配置
- 自定義驗證碼
- phpoffice/phpspreadsheet
- 數據寫入表格
- 讀取表格數據
- topthink/think-queue
- 安裝
- 自定義函數
- 任務類
- 帶有日志的任務類