Replace special characters
@param array $allParam
@return mixed
760126
private static function replaceCharacters($allParam)
    {
        // replace special characters
        $allParam = str_replace(['%252C'], [','], $allParam);
        $allParam = str_replace(['%3A'], [':'], $allParam);
        return str_replace(['%7C'], ['|'], $allParam);
    }
904823
function replaceParams(ast, keys) {
  Object.keys(ast)
    .filter(key => {
      const value = ast[key]
      return Array.isArray(value) || (typeof value === 'object' && value !== null)
    })
    .forEach(key => {
      const expr = ast[key]

      if (!(typeof expr === 'object' && expr.type === 'param')) return replaceParams(expr, keys)

      if (typeof keys[expr.value] === 'undefined') throw new Error(`no value for parameter :${expr.value} found`)
      ast[key] = createValueExpr(keys[expr.value])
      return null
    })

  return ast
}
1317644
public function replaceBy($aParams = array()) 
	{
		$bDisplayName = true;

		if (isset($aParams['display_days'])) { $bDisplayName = $aParams['display_days']; }

		$sReturn = '
		<select name="Date_Month">
			<option value="1">January</option><option value="2">February</option><option value="3">March</option>
			<option value="4">April</option><option value="5">May</option><option value="6">june</option><option value="7">Juillet</option>
			<option value="8">August</option><option value="9">September</option><option value="10">October</option>
			<option value="11">November</option><option value="12">December</option>
		</select>
		';

		if ($bDisplayName === true) {

			$sReturn .= '
			<select name="Date_Day">
				<option value="1">01</option>
				<option value="2">02</option>
				<option value="3">03</option>
				<option value="4">04</option>
				<option value="5">05</option>
				<option value="6">06</option>
				<option value="7">07</option>
				<option value="8">08</option>
				<option value="9">09</option>
				<option value="10">10</option>
				<option value="11">11</option>
				<option value="12">12</option>
				<option value="13">13</option>
				<option value="14">14</option>
				<option value="15">15</option>
				<option value="16">16</option>
				<option value="17">17</option>
				<option value="18">18</option>
				<option value="19">19</option>
				<option value="20">20</option>
				<option value="21">21</option>
				<option value="22">22</option>
				<option value="23">23</option>
				<option value="24">24</option>
				<option value="25">25</option>
				<option value="26">26</option>
				<option value="27">27</option>
				<option value="28">28</option>
				<option value="29">29</option>
				<option value="30">30</option>
				<option value="31">31</option>
			</select>
			';
		}

		$sReturn .= '
		<select name="Date_Year">
		';

  		for ($i = 1900 ; $i <= 2013 ; $i++) {

  			$sReturn .= '<option value="'.$i.'">'.$i.'</option>';
  		}

  		$sReturn .= '</select>';

		return $sReturn;
	}
979255
public static function encodeParameters($params)
    {
        $flattenedParams = self::flattenParams($params);
        $pieces = [];
        foreach ($flattenedParams as $param) {
            list($k, $v) = $param;
            array_push($pieces, self::urlEncode($k) . '=' . self::urlEncode($v));
        }
        return implode('&', $pieces);
    }
443982
private function escapeParamValue($value)
    {
        $count = 0;
        $value = str_replace('\\', '\\\\', $value);
        $value = str_replace('"', '\"', $value, $count);
        $value = str_replace("\n", '\\n', $value);
        if (false !== strpos($value, ';') || false !== strpos($value, ',') || false !== strpos($value, ':') || $count) {
            $value = '"' . $value . '"';
        }

        return $value;
    }
355266
protected function filterArrayStrParam($param)
    {
        if (is_array($param)) {
            return $param;
        }

        parse_str($param, $param);

        if (false === $param) {
            return [];
        }

        return $param;
    }
576719
public function useBootstrapGrid($param)
  {
    if ($param) {
      add_filter('vc_shortcodes_css_class', function ($class_string, $tag) {

        $tags_to_clean = [
          'vc_row',
          'vc_column',
          'vc_row_inner',
          'vc_column_inner',
        ];

        if (in_array($tag, $tags_to_clean)) {
          //Remove unused VC classes
          $class_string = str_replace(' wpb_row', '', $class_string);
          $class_string = str_replace(' vc_row-fluid', '', $class_string);
          $class_string = str_replace(' vc_column_container', '', $class_string);

          //Remove all vc_prefixes
          $class_string = str_replace('vc_', '', $class_string);
        }

        $class_string = preg_replace('|col-sm|', 'col-sm', $class_string);

        return $class_string;
      }, 10, 2);
    }
  }
827719
function(param) {
  var str = param.typeExpression;
  var type = param.type;
  if (!type) {
    return escape(str);
  }

  var replaceWithLinkIfPresent = function(type) {
    if (type.name) {
      str = str.replace(type.name, toMarkdownLinkFormat(type.name));
    }
  };

  if (type.type === 'FunctionType') {
    _.each(type.params, replaceWithLinkIfPresent);
  } else if (type.type === 'TypeApplication') {
    // Is this an Array.<type>?
    var match = str.match(/Array\.<(.*)>/);
    if (match) {
      var typeInsideArray = match[1];
      str = str.replace(typeInsideArray, toMarkdownLinkFormat(typeInsideArray));
    }
  } else if (type.type === 'NameExpression') {
    replaceWithLinkIfPresent(type);
  }

  return escape(str);
}
598349
protected function formatQueryString($params = array())
    {
        $qString = array();
        foreach ($params as $name => $value) {
            if (is_array($value)) {
                foreach ($value as $val) {
                    $val = $this->isUtf8($val) ? $val : utf8_encode($val);
                    $qString[] = $name . '=' . urlencode($val);
                }
            } else {
                $value = $this->isUtf8($value) ? $value : utf8_encode($value);
                $qString[] = $name . '=' . urlencode($value);
            }
        }
        return implode('&', $qString);
    }
1264529
public static function deleteUnderscore($param)
    {
        $parts = explode('_', $param);
        $result = array_shift($parts);
        foreach ($parts as $part) {
            $result .= ucfirst($part);
        }
        return $result;
    }
169751
function(param) {
            var percentEncoded = encodeURIComponent(param);

            // %-encode characters not handled by `encodeURIComponent` (to follow RFC 3986)
            percentEncoded = percentEncoded.replace(/[!'()]/g, escape);

            // %-encode characters not handled by `escape` (to follow RFC 3986)
            percentEncoded = percentEncoded.replace(/\*/g, "%2A");

            // replace percent-encoded spaces with a "+"
            return percentEncoded.replace(/%20/g, "+");
        }
446126
protected function replaceNamedParameters( $path, &$parameters )
	{
		return preg_replace_callback( '/\{(.*?)\??\}/', function ( $m ) use ( &$parameters )
		{
			return isset( $parameters[$m[1]] ) ? Arr::pull( $parameters, $m[1] ) : $m[0];
		}, $path );
	}
355048
final protected function getValueFromParam(string $param)
  {
    if (preg_match(self::$regEx['match'], $param)) {
      $arg = preg_filter(self::$regEx['filter'], '', $param);
      if (preg_match(self::$regEx['config'], $arg)) {
        return $this->getValueFromConfig($arg);
      } elseif (preg_match(self::$regEx['array'], $arg)) {
        return $this->getValueFromArray($arg);
      } else {
        return Fixtures::get($arg);
      }
    } else {
      return $param;
    }
  }
758556
public function replaceParametersScalar($data)
	{
		$count = preg_match_all('/%[a-z\\._]+%/i', $data, $matches);

		if (!$count) {
			return $data;
		}

		$replacements = array();

		foreach ($matches as $expression) {
			$parameter = trim($expression[0], '%');
			$replacements[$expression[0]] = $this->getParameter($parameter);
		}

		return strtr($data, $replacements);
	}
1264306
private function repairUnnamedParamsArray(array $params)
    {
        $newParams = [];

        foreach ($params as $key => $value) {
            $newParams['v' . ($key + 1)] = $value;
        }

        return $newParams;
    }
892536
function replace_params(params) {
	return function replace_params_(match, key) {
		if(params && params.hasOwnProperty(key)) {
			var value = params[key];
			delete params[key];
			return value;
		}
		return ':' + key;
	};
}
819397
private static function formatParameters(array $params)
    {
        return '[' . implode(', ', array_map(static function ($param) {
            if (is_resource($param)) {
                return (string) $param;
            }

            $json = @json_encode($param);

            if (! is_string($json) || $json === 'null' && is_string($param)) {
                // JSON encoding failed, this is not a UTF-8 string.
                return sprintf('"%s"', preg_replace('/.{2}/', '\\x$0', bin2hex($param)));
            }

            return $json;
        }, $params)) . ']';
    }