Let's say I have a string: something
When I escape it in JS I get this: %73%6F%6D%65%74%68%69%6E%67
so I can use this code in JS to decode it:
document.write(unescape('%73%6F%6D%65%74%68%69%6E%67'));
I need the escape function in PHP which will do the same (will encode something to : %73%6F%6D%65%74%68%69%6E%67)
How to do that ?
PHP:
rawurlencode("your funky string");
JS:
decodeURIComponent('your%20funky%20string');
Don't use escape
as it is being deprecated.
rawurldecode('%73%6F%6D%65%74%68%69%6E%67');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With