The rawurldecode()
function converts a %-escaped string into its original format,
reversing the operation of rawurlencode()
.
PHP rawurldecode() Function has the following syntax.
string rawurldecode ( string str )
str
is the string value to convert.
PHP rawurldecode() Function returns string value in its original format.
Escape string to url format and convert it back
<?PHP
$name = 'PHP from java2s.com';
$safe_name = rawurlencode($name);
print $safe_name;
print "\n";
$unsafe_name = rawurldecode($name);
print $unsafe_name;
?>
The code above generates the following result.