Turns an associative array into url parameters, also slugs entries
from ["foo" => "bar", "key" => "val"] to foo=bar&key=val
@param array $arrParams
@return string
555807
public static function array2UriParams(array $arrParams) : string
    {
        $arrKeyVal = [];
        foreach ($arrParams as $key => $value) {
            $arrKeyVal[] = urlencode($key)."=".urlencode($value);
            //Not using slugify, want to be able to have php decode
        }
        $arrReturn = implode("&", $arrKeyVal);
        return $arrReturn;
    }
1080192
private static function getParamObject(array $params) {
        $obj              = new stdClass;
        $obj->paramData   = array();
        $obj->paramIsFile = array();
        foreach ($params as $key => $value) {
            if (strpos($key, '@') === 0) {
                $obj->paramData[substr($key, 1)]   = self::safeGetContents($key, $value);
                $obj->paramIsFile[substr($key, 1)] = true;
            } elseif (strpos($key, '#') === 0) {
                $obj->paramData[substr($key, 1)]   = $value;
                $obj->paramIsFile[substr($key, 1)] = true;
            } else {
                $obj->paramData[$key]   = $value;
                $obj->paramIsFile[$key] = false;
            }
        }
        return $obj;
    }
1211752
protected function generateStandardUrl(array $urlParameters = array(), $absolute = false)
    {
        $urlParameters = $this->addRequestVariablesToUrlParameters($urlParameters);

        $anchor = '';
        if ($this->hasAnchor())
        {
            $anchor = '#'.$this->getAnchor();
        }

        return $this->getRouter()->generate($this->getRouteName(), $urlParameters, $absolute) . $anchor;
    }
156123
public function url( array $args = []) {
		$url = get_term_link( $this->term );
		if ( $args ) {
			$url = add_query_arg( $args, $url );
		}

		return $url;
	}
528970
public function getEncodeArray(array $args) {
        $data = [];
        foreach ($args as $key => $item) {
            $data[] = sprintf('%s=%s', urlencode($key), urlencode($item));
        }
        return sprintf('{%s}', implode('&', $data));
    }
1148068
public function getPagerUrl($params = [])
    {
        $urlParams = [];
        $urlParams['_current'] = true;
        $urlParams['_escape'] = true;
        $urlParams['_use_rewrite'] = true;
        $urlParams['_query'] = $params;

        return $this->getUrl('*/*/*', $urlParams);
    }
5810
public static function getUrlQuery(array $array_query)
    {
        $tmp = [];
        foreach ($array_query as $name => $value) {
            if (is_array($value)) {
                foreach ($value as $k => $v) {
                    $tmp[] = "{$name}[{$k}]={$v}";
                }
            } else {
                $tmp[] = "{$name}={$value}";
            }
        }
        
        return implode('&', $tmp);
    }
457361
private function formatParams(array $params) {
        foreach ($params as $key => $value) {
            if (is_array($value)) {
                $params[$key] = implode(',', $value);
            } else if (is_bool($value)) {
                $params[$key] = $value ? 1 : 0;
            }
        }
        return $params;
    }
509599
private function getParams(array $args)
    {
        if (count($args) == 0) {
            return [];
        }

        $params = array_slice($args, -1)[0];

        return is_array($params) ? $params : [];
    }
373422
public function buildQuery(array $args = []): string
	{
		$out = array_merge(
			$this->payment->getArgs(), // Arguments of the payment
			$args, // Optional helper arguments
			['signature' => $this->payment->getSignature()] // Signature
		);

		$str = [];
		/** @var string|int $val */
		foreach ($out as $key => $val) {
			$str[] = rawurlencode((string) $key) . '=' . rawurlencode((string) $val);
		}

		return implode('&', $str);
	}
159021
private function preParseParams(array $params)
    {
        if (!array_key_exists('fields', $params) || !is_array($params['fields'])) {
            return $params;
        }

        $fields = [];
        foreach ($params['fields'] as $index => $field) {
            if (!is_numeric($index)) {
                $fields[$index] = $field;
                continue;
            }

            $modifier = 1;
            /** @noinspection SubStrUsedAsArrayAccessInspection */
            $firstChar = substr($field, 0, 1);
            if ($firstChar === '+' || $firstChar === '-') {
                $modifier = $firstChar === '+' ? 1 : 0;
                $field = substr($field, 1);
            }
            $fields[$field] = $modifier;
        }
        $params['fields'] = $fields;

        return $params;
    }
1294939
public function transformParams(array $params): array
    {
        $newParams = [];
        foreach ($params as $key => $value) {
            $newParams['%' . $key . '%'] = $value;
        }

        return $newParams;
    }
469197
public function buildAuthUrl(array $params = [])
    {
        $defaultParams = [
            'appid' => $this->clientId,
            'response_type' => 'code',
            'redirect_uri' => $this->getReturnUrl(),
        ];
        if (!empty($this->scope)) {
            $defaultParams['scope'] = $this->scope;
        }

        if ($this->validateAuthState) {
            $authState = $this->generateAuthState();
            $this->setState('authState', $authState);
            $defaultParams['state'] = $authState;
        }

        return $this->composeUrl($this->authUrl, array_merge($defaultParams, $params));
    }
728343
static function ArrayToQueryString($arr)
	{
		$qs = $arr;

		if (is_array($arr))
		{
			// convert the data array into a url querystring
			$qs = "";
			$delim = "";
			foreach (array_keys($arr) as $key)
			{
				$qs .= $delim . $key ."=" . $arr[$key];
				$delim = "&";
			}
		}

		return $qs;
	}
954992
public function getValues ($arrParams)
	{
	
		// If the params are not valid return FALSE

		if (!$this->validateParams ($arrParams))
		{
			return FALSE;
		}

		// Query
		
		$query = $this->genQuery ($arrParams);
		
		// Execute

		$query->execute ();
		
		// If there is only 1 select param and it does not have *
		
		$arrSelect	= is_array ($arrParams['select'])? $arrParams['select'] : explode (',', $arrParams['select']);
		
		if (count ($arrSelect) === 1 && strpos ($arrSelect[0], '*') === FALSE)
		{

			// Set fetch mode to return only the first column of each row
			
			$query->setFetchMode (\PDO::FETCH_COLUMN, 0);

		}
		else
		{

			// Set fetch mode to return all rows
			
			$query->setFetchMode (\PDO::FETCH_ASSOC);

		}

		// Fetch the first set of results

		$arrResult	= $query->fetchAll ();
		
		// Return result

		return $arrResult;

	}
470483
public function url( array $args = [] ) {
		$url = get_permalink( $this->ID );
		if ( $args ) {
			$url = add_query_arg( $args, $url );
		}

		return $url;

	}
1070804
public function formatArgs(array $args)
    {
        $result = [];
        foreach ($args as $key => $item) {
            if ('object' === $item[0]) {
                $parts = explode('\\', $item[1]);
                $short = array_pop($parts);
                $formattedValue = sprintf('<em>object</em>(<abbr title="%s">%s</abbr>)', $item[1], $short);
            } elseif ('array' === $item[0]) {
                $formattedValue = sprintf('<em>array</em>(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
            } elseif ('string' === $item[0]) {
                $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->getCharset()));
            } elseif ('null' === $item[0]) {
                $formattedValue = '<em>null</em>';
            } elseif ('boolean' === $item[0]) {
                $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>';
            } elseif ('resource' === $item[0]) {
                $formattedValue = '<em>resource</em>';
            } else {
                $formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES, $this->getCharset()), true));
            }

            $result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);
        }

        return implode(', ', $result);
    }