You are here

function Services_JSON::name_value in Album Photos 6.2

array-walking function for use in generating JSON-formatted name-value pairs

@access private

Parameters

string $name name of key to use:

mixed $value reference to an array element to be encoded:

Return value

string JSON-formatted name-value pair, like '"name":value'

File

php/json-php4.php, line 433

Class

Services_JSON
Converts to and from JSON format.

Code

function name_value($name, $value) {
  $encoded_value = $this
    ->encode($value);
  if (Services_JSON::isError($encoded_value)) {
    return $encoded_value;
  }
  return $this
    ->encode(strval($name)) . ':' . $encoded_value;
}