api/MarkLogic/MLPHP/RESTRequest.php
public function buildQuery()
    {
        $query = '';
        if (!empty($this->params)) {
            foreach($this->params as $key => $val) {
                if (!is_array($val)) {
                    $query .= urlencode($key) . '=' . urlencode($val) . '&';
                } else {
                    foreach($val as $v) {
                        $query .= urlencode($key) . '=' . urlencode($v) . '&';
                    }
                }
            }
            // Remove trailing '&'
            $query = substr($query, 0, -1);
        }
        return $query;
    }
public function buildQuery()
    {
        $query = '';
        if (!empty($this->params)) {
            foreach($this->params as $key => $val) {
                if (!is_array($val)) {
                    $query .= urlencode($key) . '=' . urlencode($val) . '&';
                } else {
                    foreach($val as $v) {
                        $query .= urlencode($key) . '=' . urlencode($v) . '&';
                    }
                }
            }
            // Remove trailing '&'
            $query = substr($query, 0, -1);
        }
        return $query;
    }
Build query from resource and params. Accounts for the fact that some param
keys may be associated with arrays, which will generate the same keys multiple
times in the query, e.g.:
params: array("foo"=>["bar", "baz"])
query:  ?foo=bar&foo=baz

@return string The built query.