Encode/Decode URL in Javascript and PHP

1 · Subin Siby · July 19, 2013, 3:30 a.m.
URL encoding and decoding can be done in both Javascript and PHP. In this post I’m going to tell you the functions used in both languages for url encoding/decoding. Javascript Encoding encodeURIComponent(url); Decoding decodeURIComponent(url); PHP Encoding urlencode(url); Decoding urldecode(url); There is an encodeURI and decodeURI function in Javascript but it won’t encode/decode the url. Note that the the word used in Javascript is URI not URL....