URL Encoding and Decoding in PHP
There are two separate methods in PHP for this task - one for encoding and one for decoding.
Encoding - urlencode ( string $string ) : string
Decoding - urldecode ( string $string ) : string
URL Encoding and Decoding in JavaScript
There are two built-in methods in JS for this task and two extra methods to encode/decode parts of URL.
Encoding - encodeURI()
Decoding - decodeURI()
Encode/decode URI component.
Encoding - encodeURIComponent()
Decoding - decodeURIComponent()