Anybody got a JS call to undo PHP's URL encoding?

R

Robert Oschler

There are time when I like to pass strings from PHP server side code to one
of my web pages that takes a message from a search argument on the URL line
(GET). The decodeURI() call does not fully decode the message. For
example, it misses spaces ('+') and at-signs ('@'), the former are untouched
and the latter are not decoded from %40.

There may be more but that's a short list. Does anyone have a Javascript
call to undo the effects of PHP URL argument encoding?

thx
 
J

Janwillem Borleffs

Robert Oschler said:
There may be more but that's a short list. Does anyone have a Javascript
call to undo the effects of PHP URL argument encoding?

You could use unescape(), but I wouldn't recommend it because PHP's
urldecode() function does the job just fine.


JW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top