# request-\>getQueryParams()

**URL:** https://discourse.slimframework.com/t/request-getqueryparams/618
**Category:** Questions
**Created:** [August 15, 2016, 2:15pm UTC](https://discourse.slimframework.com/t/request-getqueryparams/618 "2016-08-15T14:15:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![elvisreis](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/elvisreis/32/1298_2.png) [@elvisreis](https://discourse.slimframework.com/u/elvisreis)
#### Post date: [August 15, 2016, 2:15pm UTC](https://discourse.slimframework.com/t/request-getqueryparams/618/1 "2016-08-15T14:15:06Z")

</div>

$request-\>getQueryParams();

[http://127.0.0.1:8082/api/user?user.name=Elvis&user.city=Rio+Preto](http://127.0.0.1:8082/api/user?user.name=Elvis&user.city=Rio+Preto)

$queryParams = [  
‘user\_name’ =\> ‘Elvis’,  
‘user\_city’ =\> ‘Rio Preto’  
]

the right would return  
$queryParams = [  
‘[user.name](http://user.name)’ =\> ‘Elvis’,  
‘user.city’ =\> ‘Rio Preto’  
]

---

<div class="post-metadata">

### Author: ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)
#### Post date: [August 15, 2016, 8:58pm UTC](https://discourse.slimframework.com/t/request-getqueryparams/618/2 "2016-08-15T20:58:53Z")

</div>

The [getQueryParams](https://github.com/slimphp/Slim/blob/1dedd2592c4f7e088ee3a87a7936f5df71cb7593/Slim/Http/Request.php#L759) function uses PHP’s [parse\_str](http://php.net/manual/en/function.parse-str.php) function which will convert things like dots and spaces to underscores. [PHP variable names cannot contain periods](http://php.net/variables.external) so they are converted to underscores.

> Dots and spaces in variable names are converted to underscores. For example `<input name="a.b" />` becomes `$_REQUEST["a_b"]`.

---

<div class="post-metadata">

### Author: ![elvisreis](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/elvisreis/32/1298_2.png) [@elvisreis](https://discourse.slimframework.com/u/elvisreis)
#### Post date: [August 16, 2016, 1:02am UTC](https://discourse.slimframework.com/t/request-getqueryparams/618/3 "2016-08-16T01:02:39Z")

</div>

thanks for the answer
