 last thing done in the function you call it from.
For example, if you build a page in one of your controller functions, don't set the output until the end.</p>


<h2>$this->output->set_content_type();</h2>

<p>Permits you to set the mime-type of your page so you can serve JSON data, JPEG's, XML, etc easily.</p>

<code>$this->output<br/>
&nbsp;&nbsp;&nbsp;&nbsp;->set_content_type('application/json')<br/>
&nbsp;&nbsp;&nbsp;&nbsp;->set_output(json_encode(array('foo' => 'bar')));<br/>
<br/>
$this->output<br/>
