Question: What if I pass my searching params in uri request in json-format like this:

```
http://example.com/?search={"title":"Some+Title","category":12}

```

instead of

```
http://example.com/?title=Some+Title&category=12

```

Before decode json-request I can filter it with some functions like strip\_tags(), strpslashes(), etc... But I can do the same with $\_SERVER['QUERY\_STRING'] with serialize()/unserialize(). Or apply string-filters to N string-params of request, not once to whole request.

Which way do you think will be better, usable and faster to process?

### With json

```
$request = $_GET['search'];
$request = stripslaches(strip_tags($request));
$params  = json_decode($request);

```

Answer: 
Isn't it better to use [`http_build_query`](http://php.net/manual/en/function.http-build-query.php) instead of passing JSON throw URL? HTTP\_build\_query is specially designed to pass data throw url params.

Applying this filter to whole `param_str` of URL may cause unexpected behaviour, besides fact that is actually little bit faster.
I think that you should pass every one parameter throw your filter functions.
Why don't you just represent everything with JSON?

```
http://www.example.com/{"article":"something","page":12,"fragment":"#menu"}

```

Query strings are already used to represent flat lists of key-value pairs, so what problem does your JSON solution solve? You'll just be adding a new layer of complexity without any benefits.