title: PHP parse REQUEST_URI into array
body: <p>I am parsing the REQUEST_URI into an array.</p>
  
  <p>Right now i have the following code:</p>
  
  <pre><code>private function load_url_vars()
  {
      if (preg_match('/^.+\?(.+)$/', $_SERVER["REQUEST_URI"], $matches))
      {
          $varpairs = preg_split("/&amp;/", $matches[1]);
          foreach ($varpairs as $varpair)
          {
              if (preg_match('/^([A-Za-z_]+)=(.*)$/', $varpair, $varmatch))
              {
                  $this-&gt;urlvars[$varmatch[1]] = urldecode($varmatch[2]);
              }
          }
      }
  }
  </code></pre>
  
  <p>Are there any security concerns by doing it this way? Is this a good way of parsing it?</p>
  
  <p>Edit: language</p>