16         $semicolon_pos = strrpos($uri->path, 
';'); 
 
   17         if ($semicolon_pos !== 
false) {
 
   18             $type = substr($uri->path, $semicolon_pos + 1); 
 
   19             $uri->path = substr($uri->path, 0, $semicolon_pos);
 
   21             if (strpos($type, 
'=') !== 
false) {
 
   23                 list($key, $typecode) = explode(
'=', $type, 2);
 
   24                 if ($key !== 
'type') {
 
   26                     $uri->path .= 
'%3B' . $type;
 
   27                 } elseif ($typecode === 
'a' || $typecode === 
'i' || $typecode === 
'd') {
 
   28                     $type_ret = 
";type=$typecode";
 
   31                 $uri->path .= 
'%3B' . $type;
 
   33             $uri->path = str_replace(
';', 
'%3B', $uri->path);
 
   34             $uri->path .= $type_ret;