Created
October 23, 2016 19:52
-
-
Save walkerdigital/40840e052774970721a7e394e2c3490e to your computer and use it in GitHub Desktop.
CodeIgniter - Output Class - JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->output | |
->set_content_type('application/json') | |
->set_output(json_encode(array('foo' => 'bar'))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.