I need to check a cell with the effect underline or not.
I'm trying this code:
$reader1 = new \PhpOffice\PhpSpreadsheet\Reader\Xls();
$workbook1 = $reader1->load($file1);
$worksheet1 = $workbook1->getSheet(0);
$cellunderline = $worksheet1->getCellByColumnAndRow(1, 1)->getStyle()->getFont()->getUnderline();
if($cellunderline){
// The cell is underline true
}
I have testing with the $cellunderline with the value:
And also I have testing with the $cellundeline value:
The problem is always the $cellunderline is true. I have tried to set the result of $cellunderline in a new cell to see the value but it's empty in the document.
I'm not sure what is happen and why is not working.
Please Could you help me with this issue?
I use the php library phpspreadsheet. The documentation here.