Which JavaScript function is compatible with the PHP urldecode function?

On the server side, the PHP code will use the function urldecode()to decode, but the JavaScript code is responsible for encoding the URL. Which of the following JavaScript functions is compatible with the PHP function urldecode():

  • escape ()
  • encodeURI ()
  • encodeURIComponent ()
+5
source share
1 answer

You can use either encodeURIor encodeURIComponent. The php manual says:

Decodes any% ## encoding in a given string.

, , , %## . , JavaScript .

:

( Gumbo, ?)

php urldecode + ( ). , , , php, encodeURIComponent, . + %2B, php urldecode.

+1

All Articles