PHP rawurldecode() Function

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 ww  w . jav a 2  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.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions