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: 
The characters *{* and *}* are unsafe according to RFC 1738 2.2. They must therefore be encoded before being transferred over a network.

The character *:* is reserved according to RFC 1738 2.2. It must therefore be encoded before being transferred over a network unless it is used for the purpose for which it was reserved.

Don't use `$request = striplashes(strip_tags($request))`. If `$_GET['search']` does not `json_decode` sucessfully, treat it as faulty input; don't try to fix it.
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.