Search code examples
phphashtaghtmlspecialchars

Convert '%23' to '#' in PHP


URL: example.com/search:#searchWord

Since the # is not send to the server, it is changed to %23.

In the search page I want to display

Results for: #searchWord

But what I get is %23searchWord. I tried htmlspecialchars(), but nothing happens.


Solution

  • To achieve your goal use urldecode.