• 读取文件已支持 windows 系统,版本号大于等于 1.3.4.1
  • 扩展版本大于等于 1.2.7
  • PECL 安装时将会提示是否开启读取功能,请键入 yes

编译

编译时需添加 --enable-reader

./configure --enable-reader

示例

  1. $config = ['path' => './tests'];
  2. $excel = new \Vtiful\Kernel\Excel($config);
  3. // 导出测试文件
  4. $filePath = $excel->fileName('tutorial.xlsx')
  5. ->header(['Item', 'Cost'])
  6. ->output();
  7. // 读取测试文件
  8. $data = $excel->openFile('tutorial.xlsx')
  9. ->openSheet()
  10. ->getSheetData();
  11. var_dump($data); // [['Item', 'Cost']]