Search code examples
phpjavascripturlencode

JavaScript encodeURIComponent vs PHP ulrencode


The difference between them is that the PHP's urlencode encodes spaces with + instead of %20?

What are the functions that do the same thing for both the languages?


Solution

  • Use rawurlencode instead of urlencode in PHP.