'; $output .= ''.implode('',array_keys($cols)).''; foreach ($data as $do) { if ($i++ < $rows) { $output .= ''; foreach (array_values($cols) as $col) { if (is_array($do) AND isset($do[$col])) $x = $do[$col]; // If the col is a method, we need to eval it elseif (preg_match('/\(/',$col)) eval("\$x = \$do->$col;"); else $x = $do->{$col}; $output .= sprintf('%s',$x); } $output .= ''; } else { if (is_array($do) AND isset($do[$col])) $x = $do[$col]; // If the col is a method, we need to eval it elseif (preg_match('/\(/',$col)) eval("\$x = \$do->$col;"); else $x = $do->{$col}; $other += $x; } } if ($other) $output .= sprintf('Other(%s) %s',count($cols)-1,$i-$rows,$other); $output .= ''; return $output; } } ?>