PHP equivalent for javascript escape/unescape

后端 未结 3 875
半阙折子戏
半阙折子戏 2020-12-10 05:45

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

3条回答
  •  被撕碎了的回忆
    2020-12-10 06:01

    PHP:

    rawurlencode("your funky string");
    

    JS:

    decodeURIComponent('your%20funky%20string');

    Don't use escape as it is being deprecated.

提交回复
热议问题