rawurldecode
Decode the encoded URL string
Function: rawurldecode()
Applicable version: PHP 4, PHP 5, PHP 7
Usage: rawurldecode(string $str): string
Function function: decode URL-encoded strings and restore special characters to original characters.
parameter:
Return value:
Example:
$url = 'http%3A%2F%2Fwww.example.com%2Fpage%3Fid%3D123%26name%3DJohn%20Doe'; $decodedUrl = rawurldecode($url); echo $decodedUrl;
Output:
http://www.example.com/page?id=123&name=John Doe
In the example above, we have a URL-encoded string that is decoded using the rawurldecode() function. The decoded string can be displayed normally, and special characters (such as colons, slashes, and spaces) are restored to the original characters.