I’m reading a spreadsheet and and dropping it into an array (I will shortly be inserting this into a database but for now im just doing a vardump for testing) using this code:
$objPHPExcel->setActiveSheetIndex(1);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
?><pre><?php var_dump($sheetData);
Now this works great as I expected but the sheet has a large number of blank rows which are also returned in the array, is there a way of getting only the rows that contain data?
Unfortunately not, you’d need to loop each row returned by toArray(), checking each cell within that row to see if it is empty or not