Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

escaping get request in php

11:37 pm on Jun 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

I am looking to send some information with the Get request but when I read the variable in PHP it is all encoded. I have been trying to locate the function that uncodes this. Anyone know this off the top of their head?


2:24 pm on Jun 30, 2002 (gmt 0)

10+ Year Member

rawurldecode() and urldecode()

The difference (as far as I can see) is that if spaces have been encoded as +, you will need urldecode().

rawurldecode("foo%20bar") == "foo bar"
urldecode("foo+bar") == "foo bar"

If in doubt, urldecode() is probably the one to use.

To encode URLs, of course, use rawurlencode() or urlencode() as appropriate.