$value) { if($count !== NULL && (gettype($key) !== 'integer' || $count++ !== $key)) { $count = NULL; } $one = self::encode($value); $indexed[] = $one; $associative[] = self::encode($key) . ':' . $one; } if ($count !== NULL) { return '[' . implode(',', $indexed) . ']'; } else { return '{' . implode(',', $associative) . '}'; } default: return ''; // Not supported } } } ?>