The JSON helper is useful when working with data that needs to be decoded from or encoded to the JSON format. You can learn more about JSON here.

concrete5 uses JSON to communicate between the dashboard sitemap and the backend, and to/from the concrete5 marketplace.

Loading the Helper

$js = Loader::helper(‘json’);

Methods

$r = $js->decode($string)

Decodes a string of JSON data into a PHP object or array.

$r = $js->encode($item)

Encodes a PHP object or array $item into a JSON string and returns it.

Recent Discussions on this Topic

No responses have been posted yet.