更新时间:2023-02-04 20:47:52
$workbook = new PHPExcel;
$sheet = $workbook->getActiveSheet();
$sheet->mergeCells('A1:E1');
$cell = $sheet->getCell('A1');
// Check if cell is merged
foreach ($sheet->getMergeCells() as $cells) {
if ($cell->isInRange($cells)) {
echo 'Cell is merged!'
break;
}
}
由于phpexcel存储有关合并单元格信息的方式,我认为没有更好的解决方案.
I think there isn't better solution because of the way phpexcel stores information about merged cells.