49

I have a string with unicode characters that I am transferring via HTTP. This string was encoded with Javascript's encodeURIcomponent(). Is there an equivalent function in php to Javascript's decodeURIComponent()?

jwir3
  • 6,019
  • 5
  • 47
  • 92
neonant
  • 832
  • 3
  • 16
  • 25

2 Answers2

72
urldecode()

However you do not need to use it on $_REQUEST variables, which are already decoded automatically.

Explosion Pills
  • 188,624
  • 52
  • 326
  • 405
7

rawurldecode() which does not decode plus to space charactor

Vincent
  • 1,178
  • 1
  • 12
  • 25