startRow = $startRow; $this->endRow = $endRow; } public function readCell($column, $row, $worksheetName = '') { if ($row >= $this->startRow && $row <= $this->endRow) { return true; } return false; } // 标准示例 调用 new MyReadFilter(9,15,range('G','K')); /* private $startRow = 0; private $endRow = 0; private $columns = []; public function __construct($startRow, $endRow, $columns) { $this->startRow = $startRow; $this->endRow = $endRow; $this->columns = $columns; } public function readCell($column, $row, $worksheetName = '') { // Only read the rows and columns that were configured if ($row >= $this->startRow && $row <= $this->endRow) { if (in_array($column,$this->columns)) { return true; } } return false; } */ }