PHP Function pt_register
<p>I'm a beginner with PHP, I was exposed to processed HTML forms and I'm learning how to use it to do more and more...</p>

<p>I'm using this function (and based on Google so are a lot of people) but I really want to understand what it's doing....</p>

<pre><code>function pt_register()
{
  $num_args = func_num_args();
   $vars = array();

   if ($num_args &gt;= 2) {
       $method = strtoupper(func_get_arg(0));

       if (($method != 'SESSION') &amp;&amp; ($method != 'GET') &amp;&amp; ($method != 'POST') &amp;&amp; ($method != 'SERVER') &amp;&amp; ($method != 'COOKIE') &amp;&amp; ($method != 'ENV')) {
           die('The first argument of pt_register must be one of the following: GET, POST, SESSION, SERVER, COOKIE, or ENV');
     }

       $varname = "HTTP_{$method}_VARS";
      global ${$varname};

       for ($i = 1; $i &lt; $num_args; $i++) {
           $parameter = func_get_arg($i);

           if (isset(${$varname}[$parameter])) {
               global $$parameter;
               $$parameter = ${$varname}[$parameter];
          }

       }

   } else {
       die('You must specify at least two arguments');
   }

}
</code></pre>

<p>Can anyone walk through this in English for me?</p>
