function json_decode($str, $assoc = false) { $JSON =& JSON::_getJSONSingleton(); $JSON->use = $assoc ? SERVICES_JSON_LOOSE_TYPE : 0; $obj = $JSON->decode($str); return $obj; }