我想用PHPExcel列出值的下拉列表,但显示所有值并希望将它们分组,例如GROUP BY'CellValue' 我的代码是:
require_once "PHPExcel-1.8/Classes/PHPExcel.php";
$tmpfname = "table.xlsx";
$excelReader = PHPExcel_IOFactory::createReaderForFile($tmpfname);
$excelObj = $excelReader->load($tmpfname);
$worksheet = $excelObj->getSheet(0);
$lastRow = $worksheet->getHighestRow();
echo "<select name=''>";
for ($row = 1; $row <= $lastRow; $row++) {
echo "<option value=''>";
echo $worksheet->getCell('C'.$row)->getValue();
echo "</option>";
}
echo "</select>";