title: Put $_GET parameter in php variable
body: <p>Is it possible to take $_GET parameter from the url and put it in php variable without using foreach?
  If I do:</p>
  
  <pre><code>var_dump($_GET); 
  </code></pre>
  
  <p>I will get the result:</p>
  
  <pre><code>array(1) { ["block_simple_clock"]=&gt; string(0) "" } 
  </code></pre>
  
  <p>I need to put that value block_simple_clock in a string variable, and I can do that with a foreach:</p>
  
  <pre><code>foreach($_GET as $key =&gt; $value) {
      var_dump($key);
  }
  </code></pre>
  
  <p>But I would really like to take that value without a foreach if it is possible. I hate using foreach for such a trivial problem :)</p>
  
  <p>Sorry for confusion, that block_simple_clock is a variable, and it can be a different value, I am sending this value with this code:</p>
  
  <pre><code>    foreach ($pluginlist-&gt;plugins as $key =&gt; $plugin) {
  
          if (empty($plugin-&gt;component)) {
              continue;
          }
  
          if (in_array($plugin-&gt;component, $arr)) {
              if (!in_array($plugin-&gt;component, $contribs)) {
                  $target_url = new moodle_url('redirect.php');
  
                  $mform-&gt;addElement('advcheckbox', $plugin-&gt;component, "&lt;a href={$target_url}?$plugin-&gt;component target='_blank'&gt;" . $plugin-&gt;name . "&lt;/a&gt;", '', array(0, 1));
                  }
              }
          $requestedPluginIdCounter++;
      }
  </code></pre>
  
  <p>As you can see the $plugin->component is the value that I am sending via $_GET.</p>