function output($results) { if ($results['head']['status'] == '0') { #Fall back to xml if errors Format::outputXml($results); } else { $xml = self::initialise(); self::outputWarning($xml, $results['head']); self::setProperties($xml); #Output each row in the body $muni_names = ApiBase::getMuniNames(); foreach ($results['body'] as $row) { self::writeRow($xml, $row, $muni_names); } #finalise self::finalise($xml); #print echo $xml->outputMemory(true); } }
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; } }