PHP code example of whx / phpexcelreader

1. Go to this page and download the library: Download whx/phpexcelreader 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/ */

    

whx / phpexcelreader example snippets



use whx\phpExcelReader\ExcelReader;

……略……

try {
    $excelReader = new ExcelReader();

    return $excelReader->readFile('./template.xlsx')
        ->getBatchSheetDataByName(['工作表3','工作表2',Sheet1])
        ->setSheetTargetColumnName([
            'Sheet1'=>['Tracking NO.','Signed Quantity']
        ])
        ->setRowIndex([
            'Sheet1'=>2
        ])
        ->isWithRawData(true)
        ->run();

}catch (\Exception $e){

    print_r($e->getMessage());

    exit();

}