PHPExcel Reader Example #09
Simple File Reader Using a Read Filter
= 1 && $row <= 7) {
if (in_array($column,range('A','E'))) {
return true;
}
}
return false;
}
}
$filterSubset = new MyReadFilter();
echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
';
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
echo 'Loading Sheet "',$sheetname,'" only
';
$objReader->setLoadSheetsOnly($sheetname);
echo 'Loading Sheet using filter
';
$objReader->setReadFilter($filterSubset);
$objPHPExcel = $objReader->load($inputFileName);
echo '
';
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
var_dump($sheetData);
?>