urldecode

urldecode -- Decodes URL-encoded string

Description

string urldecode(string str);

Decodes any %## encoding in the given string. The decoded string is returned.

Example 1. Urldecode() example

  1 
  2 $a = split ('&', $querystring);
  3 $i = 0;
  4 while ($i < count ($a)) {
  5     $b = split ('=', $a [$i]);
  6     echo 'Value for parameter ', htmlspecialchars (urldecode ($b [0])),
  7          ' is ', htmlspecialchars (urldecode ($b [1])), "<BR>";
  8     $i++;
  9 }
 10       

See also urlencode().