title: php variable variables and PHP global variables
body: <p>I am working on a javascript application that uses ajax to request data from a SOAP API by the intermediary of a PHP script.
  my ajax requests are times GET and other times POST.
  to configure the API request i created a function that, based on the HTTP method used, construct the configuration array and returns it.
  this is my function : </p>
  
  <pre><code>function configureApiRequest($source, $collection){
      $configuration = array();
      foreach ($collection as $key){
          if(strlen(${$source}[$value]) &gt; 0){
              $configuration[$key] = ${$source}[$key];
          }
      }
      return $configuration;
  }
  </code></pre>
  
  <p>and this is how i invoke it : </p>
  
  <pre><code>$configuration = configureApiRequest('_GET', array('conditions', 'orderBy', 'limit', 'skip', 'marketingGroupFilter', 'returnFields'));
  </code></pre>
  
  <p>as you can see in the function, i used PHP variable variables to determine if the method used if GET or POST. but i got the error : </p>
  
  <blockquote>
    <p>Undefined variable: _GET
    what is the problem ?</p>
  </blockquote>