PHP code example of think / phpspreadsheet

1. Go to this page and download the library: Download think/phpspreadsheet library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

think / phpspreadsheet example snippets


$path = './static/excel/$Excel['fileName'].xlsx';
Excel::excelPut($Excel,$tableData,$path);

$path = './static/test.xlsx';
// header('content-Type:text/html;charset=utf-8');
$data  = Excel::excelReader($path);// 返回拿到的数据