You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
World Wide Web Server edited this page Jul 4, 2012
·
13 revisions
The JSON helper is a simple interface to the Pear Services_JSON class created by Michal Migurski, Matt Knapp, and Brett Stimmerman.
Only two functions exist, json_encode and json_decode. Both functions take one parameter, the data to be encoded/decoded.
Once data is encoded, it is decoded in Javascript as so (javascript brackets should be parentheses):
[code]
//PHP
$data['encoded_data'] = json_encode($my_data);
$this->load->view('my_view', $data);
Save the two attached files to your system/helpers directory. Load it like any other helper:
[code]$this->load->helper('json');[/code]
** The .php file downloads do not work as expected, however, I have left them up for Rick's examination. In the mean time, use the .txt downloads but rename them to .php after you have downloaded them.
File:json_helper.txtFile:JSON.txt