我正在使用 codeigniter 框架,因为任何输出我都有这个字符“´╗┐´╗┐”
//config.php
$config['charset'] = 'UTF-8';
我的打印 http://web.wipix.com.br/Capturar.PNG
/* Model */
public function AllVotos()
{
$this->load->dbutil();
$select = $this->db->query("SELECT SUM(voto = '0') as insatisfatorio, SUM(voto = '1') as bom, SUM(voto = '2') as excelente FROM qr_wiplay_participacoes ");
$config = array (
'root' => 'root',
'element' => 'element',
'newline' => "\n",
'tab' => "\t"
);
return $this->dbutil->xml_from_result($select, $config);
}
/* Controller */
public function AllVotos(){
$xml = $this->home_model->AllVotos();
$this->output->set_content_type('text/xml');
$this->output->set_output($xml);
}