rawurldecode

string rawurldecode(string encoded_string) 

Decodes a URL-encoded string.

Returns:

Decoded string; FALSE if the argument passed has no length when converted to a string

Description:

rawurldecode() decodes a URL-encoded string. The function converts any hexadecimal escape triplets (%xx) within the string into the character that they represent.

Note that this function doesn’t convert plus signs to spaces.

Availability:

UNIX, Windows

Version:

3+, 4+

See also:

rawurlencode() 

Example:

Decode a URL-encoded string
 $string = 'This is my name with several spurious accents: Zâk Grêåñt'; $encoded_string = rawurlencode ($string); $decoded_string = rawurldecode ($encoded_string); print <<<_END_ Original String: $string Encoded String : $encoded_string ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.