public static function decode($str, $assoc = false)
    {
        if (!function_exists('json_decode')) {
            $j = self::getJsonService();
            return $j->decode($str);
        }
        else {
            return $assoc ? json_decode($str, true) : json_decode($str);
        }
    }
public static function decode($str, $assoc = false)
    {
        if (!function_exists('json_decode')) {
            $j = self::getJsonService();
            return $j->decode($str);
        }
        else {
            return $assoc ? json_decode($str, true) : json_decode($str);
        }
    }
public static function decode ( $ str , $ assoc = false ) { if ( ! function_exists ( 'json_decode' ) ) { $ j = self :: getJsonService ( ) ; return $ j -> decode ( $ str ) ; } else { return $ assoc ? json_decode ( $ str , true ) : json_decode ( $ str ) ; } }
Decodes a JSON string into appropriate variable.

@param    string  $str    JSON-formatted string
@param    boolean $accos  When true, returned objects will be converted into associative arrays.
@return   mixed   number, boolean, string, array, or object corresponding to given JSON input string.
Note that decode() always returns strings in ASCII or UTF-8 format!
Decodes a JSON string into appropriate variable .