Magento’s Core JSON Encoding and Decoding Functions

To JSON encode an array

$jsonData = Mage::helper('core')->jsonEncode($array);

To JSON decode an array

$array = Mage::helper('core')->jsonDecode($jsonData);