WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
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 (brackets should be parentheses): [code]eval["var decoded_data = " + <?php echo $encoded_data; ?>];[/code]

Save the two attached files to your system/helpers directory. Load it like any other helper: [code]$this->load->helper('json');[/code]

File:json_helper.php File:JSON.php

Clone this wiki locally