Welcome to WebmasterWorld Guest from 220.127.116.11 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Pubcon Website
escaping get request in php Lisa msg:1305577 11:37 pm on Jun 29, 2002 (gmt 0) 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?
rewboss msg:1305578 2:24 pm on Jun 30, 2002 (gmt 0)
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.