You are here

function Services_JSON::name_value in Video 7

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

modules/video_zencoder/includes/lib/JSON.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;
}