# Urldecode & urlencode deprecated

**URL:** <https://forum.getkirby.com/t/urldecode-urlencode-deprecated/30479>\
**Category:** Questions\
**Tags:** v4\
**Created:** [January 11, 2024, 3:24pm UTC](https://forum.getkirby.com/t/urldecode-urlencode-deprecated/30479 "2024-01-11T15:24:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oziris](https://avatars.discourse-cdn.com/v4/letter/o/df788c/32.png) [@Oziris](https://forum.getkirby.com/u/Oziris)\
**Post date:** [January 11, 2024, 3:24pm UTC](https://forum.getkirby.com/t/urldecode-urlencode-deprecated/30479/1 "2024-01-11T15:24:07Z")

</div>

Hi,

I was using urldecode and urlencode for my filtering tags but with php 8.2, it is deprecated, do you know how to modify it correctly ?

In my controller :

```auto
if ($tag = urldecode(param('tag'))) {
      $articles = $articles->filterBy('tags', $tag, ',');
   }

```

In my template :

`href="<?= url($site->find('programme')->url(), ['params' => ['tag' => urlencode($category)]]) ?>"`

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 11, 2024, 8:09pm UTC](https://forum.getkirby.com/t/urldecode-urlencode-deprecated/30479/2 "2024-01-11T20:09:33Z")

</div>

> [@Oziris](#):
>
> but with php 8.2, it is deprecated,

Where did you find this information? I don’t think this is the case. Do you get an error message?

Having said that, I think Kirby `rawurlencode()`s your strings when using the `url()` helper with the `params` attribute, so using `urlencode()` won’t have an effect.

---

<div class="post-metadata">

**Author:** ![Oziris](https://avatars.discourse-cdn.com/v4/letter/o/df788c/32.png) [@Oziris](https://forum.getkirby.com/u/Oziris)\
**Post date:** [January 12, 2024, 9:52am UTC](https://forum.getkirby.com/t/urldecode-urlencode-deprecated/30479/3 "2024-01-12T09:52:09Z")

</div>

I should keep a screenshot of the debug mode saying " `urlencode()` is deprecated…because I know that it is not with PHP 8.2

But it appears that removing all `urlencode` and `urldecode` from the code is working well now, with special characters and space bewteen words.

Thx
