Skip to content

Instantly share code, notes, and snippets.

@walkerdigital
Created October 23, 2016 19:52
Show Gist options
  • Save walkerdigital/40840e052774970721a7e394e2c3490e to your computer and use it in GitHub Desktop.
Save walkerdigital/40840e052774970721a7e394e2c3490e to your computer and use it in GitHub Desktop.
CodeIgniter - Output Class - JSON
$this->output
->set_content_type('application/json')
->set_output(json_encode(array('foo' => 'bar')));
@azazqadir
Copy link

To parse data in JSON format in codeigniter, you can also use codeigniter curl library. If you are using the library you won't have to setup Get and Post operations. You will have to use Post to send JSON notations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment