You are here

function KalturaClientBase::http_parse_query in Kaltura 6

Same name and namespace in other branches
  1. 5 kaltura_client/kaltura_client_base.php \KalturaClientBase::http_parse_query()
1 call to KalturaClientBase::http_parse_query()
KalturaClientBase::hit in kaltura_client/kaltura_client_base.php

File

kaltura_client/kaltura_client_base.php, line 62

Class

KalturaClientBase

Code

function http_parse_query($array = null, $convention = "%s") {
  if (!$array || count($array) == 0) {
    return '';
  }
  $query = '';
  foreach ($array as $key => $value) {
    if (is_array($value)) {
      $new_convention = sprintf($convention, $key) . '[%s]';
      $query .= http_parse_query($value, $new_convention);
    }
    else {
      $key = urlencode($key);
      $value = urlencode($value);
      $query .= sprintf($convention, $key) . "={$value}&";
    }
  }
  return $query;
}