Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Parses the string into variables
<?php parse_str(string $string, array &$result): void
<?php $query = [];
if (isset($parsedUrl['query'])) {
parse_str($parsedUrl['query'], $query);
}
return $query[$key] ?? $default;
<?php }
if (is_string($laravelData)) {
parse_str($laravelData, $parsedData);
$laravelData = is_array($parsedData) ? $parsedData : [];
}
<?php protected function parameters()
{
if (! $this->data) {
parse_str($this->body(), $parameters);
$this->data = $parameters;
}
<?php {
[$path, $existingQueryString] = $this->extractQueryString($path);
parse_str(Str::after($existingQueryString, '?'), $existingQueryArray);
return rtrim($this->to($path.'?'.Arr::query(
array_merge($existingQueryArray, $query)
<?php $query = [];
parse_str($queryString, $query);
return $this->parseStringsToNativeTypes($query);
}
<?php $query = [];
parse_str($url['query'], $query); // simply ingest query as extra params, e.g. charset or sslmode
return array_merge($params, $query); // parse_str wipes existing array elements
}
<?php );
$params = [];
parse_str($queryString, $params);
self::assertArrayHasKey('connectionParams', $params);
<?php if (str_starts_with($request->headers->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded') &&
in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), ['PUT', 'PATCH', 'DELETE'])) {
parse_str($request->getContent(), $data);
$request->request = new ParameterBag($data);
}
<?php ? sprintf('%s?token=%s', static::$url, $token)
: $defaultUrl;
parse_str(parse_url($url, PHP_URL_QUERY) ?: '', $query);
if (static::$redirect) {
$query = array_merge($query, ['redirect' => static::$redirect]);
<?php return $default;
}
parse_str($query, $query);
return array_get($query, 'redirect', $default);
}
<?php $anchor = isset($parsedUrl['fragment']) ? "#{$parsedUrl['fragment']}" : '';
parse_str($parsedUrl['query'] ?? '', $queryAssociativeArray);
unset($queryAssociativeArray[$params[0]]);
<?php $anchor = isset($parsedUrl['fragment']) ? "#{$parsedUrl['fragment']}" : '';
parse_str($parsedUrl['query'] ?? '', $queryAssociativeArray);
$queryAssociativeArray[$params[0]] = $params[1] ?? '';
<?php $args = array();
\parse_str(isset($parts['query']) ? $parts['query'] : '', $args);
if ($host !== $ip && !isset($args['hostname'])) {
$uri .= (isset($parts['query']) ? '&' : '?') . 'hostname=' . \rawurlencode($host);
}
<?php $args = array();
if (isset($parts['query'])) {
\parse_str($parts['query'], $args);
}
<?php case '~':
$style = 'meta';
if (isset($key[0][1])) {
parse_str(substr($key[0], 1), $attr);
$attr += ['binary' => $cursor->hashKeyIsBinary];
}
break;