$columnsNotEmpty = []; $count = 0; foreach ($data as $key => $row) { if ($count == 0 && $isTopHeaderFrozen) { $count++; continue; } foreach ($row as $key2 => $col) { if (!empty($col) && !in_array($key2, $columnsNotEmpty)) { array_push($columnsNotEmpty, $key2); } } $count++; } foreach ($data as $key => $row) { foreach ($row as $key2 => $col) { if (!in_array($key2, $columnsNotEmpty)) { unset($data[$key][$key2]); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)