Encode or decode a URL

From CodeCodex

Use this code to encode a url or decode a url that has already been decoded.

Implementations[edit]

Java[edit]

Encode a URL:

URLEncoder.encode("http://www.codecodex.com");

Decode a URL:

URLEncoder.decode("http://www.codecodex.com");

JavaScript[edit]

Encode a URL:

escape(String);

Decode a URL:

unescape(String);

PHP[edit]

Encode a URL:

urlencode(string)

Decode a URL:

urldecode(string)