Encodera

Thanks for reading!

Donate to the site — we work hard for you.

PHP reference

urldecode

Decodes a string from a URL.

Syntax

urldecode(string $string): string

Parameters

ParameterTypeDescription
$stringstringThe encoded string.

Return value

stringThe original string.

Examples

Decoding:

<?php
 
echo urldecode('tea+%26+coffee');

Output:

tea & coffee

Notes

The values in $_GET are already decoded. Calling urldecode() again corrupts data containing % or +.

See also

  • urlencode — Encodes a string for use in a URL.
  • parse_url — Splits a URL into its parts.

In the tutorial

  • HTTP requests and responses — How PHP receives a request and builds a response — the request method and address, headers, status codes, redirects and JSON responses.

Thanks for reading!

Donate to the site — we work hard for you.