Module url_encoding

Source

Functionsยง

url_decode
URL-decodes a percent-encoded string back to its original UTF-8 representation. Decodes percent-encoded values back to their original UTF-8 strings.
url_encode
URL-encodes a string value for use in HTTP headers or other contexts requiring ASCII-compatibility. Percent-encodes all non-alphanumeric characters (including spaces, punctuation, ASCII special characters, non-ASCII characters, and control characters) to preserve the original information while making the value ASCII-safe for use in HTTP headers or other contexts requiring ASCII-compatibility.