Cells with Boolean values TRUE and FALSE are not retrieved using PHPExcel

php, phpexcel

Solution

PHPExcel will return an actual PHP Boolean for Boolean values in cells: Standard PHP behaviour is that it will display a `1` if you echo a Boolean `true`, but nothing if you echo a Boolean `false`. If you want to see text, echo something like:

$myBoolean = FALSE;
echo ($myBoolean) ? 'TRUE' : 'FALSE';

Problem

When i am trying to read excel data using PHPExcel all data is read correctly but cells containing TRUE and FALSE are not read exactly. If TRUE is there in the cell then 1 is returned and if FALSE is there nothing is returned. Can anyone please help how to overcome this. $inputFileName="sample.xlxs"; $objPHPExcel = PHPExcel_IOFactory::load($inputFileName); $sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);

Original source