GitHubContribute in GitHub: Edit online

url_encode()

The function converts characters of the input URL into a format that can be transmitted over the Internet.

Detailed information about URL encoding and decoding can be found here. Note: Spaces are encoded as '20% (see application/x-www-form-urlencoded here).

Syntax

url_encode(url)

Arguments

  • url: input URL (string).

Returns

URL (string) converted into a format that can be transmitted over the Internet.

Examples

print url_encode('https://www.ibm.com/products/cloud-pak-for-security?mhsrc=ibmsearch_a&mhq=')

Rsults

print_0
https%3A%2F%2Fwww.ibm.com%2Fproducts%2Fcloud-pak-for-security%3Fmhsrc%3Dibmsearch_a%26mhq%3D