function output($results) { if ($results['head']['status'] == '0') { #Fall back to xml if errors Format::outputXml($results); } else { @header("content-type: text/plain; charset=UTF-8"); $muni_names = ApiBase::getMuniNames(); $county_names = ApiBase::getCountyNames(); $text = ""; $text .= self::outputWarning($results['head']); $text .= self::writeHeader(); foreach ($results['body'] as $row) { $text .= self::writeRow($row, $muni_names, $county_names); } $text .= self::writeEnder(); #print echo $text; } }