Codeigniter Echo Set Content Type

[Solved] Codeigniter Echo Set Content Type | Php Frameworks Codeigniter - Code Explorer | yomemimo.com
Question : codeigniter echo set content type

Answered by :

public function jsonExit($array)
{ $this->con->output->set_content_type('application/json'); // $this->con is get_instance from the constructor $this->con->output->set_output(json_encode($array));
}

Source : https://stackoverflow.com/questions/39170041/using-exit-in-codeigniter-output-makes-the-content-type-header-to-text-html-inst | Last Update : Mon, 31 Jan 22

Answers related to codeigniter echo set content type

Code Explorer Popular Question For Php Frameworks Codeigniter