PHP rawurldecode() Function
In this chapter you will learn:
- Definition for PHP rawurldecode() Function
- Syntax for PHP rawurldecode() Function
- Parameter for PHP rawurldecode() Function
- Return for PHP rawurldecode() Function
- Example - Escape string to url format and convert it back
Definition
The rawurldecode()
function converts a %-escaped string into its original format,
reversing the operation of rawurlencode()
.
Syntax
PHP rawurldecode() Function has the following syntax.
string rawurldecode ( string str )
Parameter
str
is the string value to convert.
Return
PHP rawurldecode() Function returns string value in its original format.
Example
Escape string to url format and convert it back
<?PHP//from j a va2 s . c om
$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.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP rawurlencode() Function
- Syntax for PHP rawurlencode() Function
- Parameter for PHP rawurlencode() Function
- Return for PHP rawurlencode() Function
- Note for PHP rawurlencode() Function
- Example - Encode a string for URL
Home » PHP Tutorial » PHP String Functions