rawurldecode()

rawurldecode() — Decode URL-encoded strings.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

What it does

Returns a string in which the sequences with percent (%) signs followed by two hex digits have been replaced with literal characters.

Signature

rawurldecode(string $string): string

Parameters

ParameterTypeWhat it takes
$stringstringThe URL to be decoded.

Return value

Returns the decoded URL, as a string.

Example

A runnable snippet:

echo rawurldecode('foo%20bar%40baz'); // foo bar@baz

See also

rawurlencode(), urldecode(), urlencode()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page rawurldecode() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.