title: PHP: How to check if query string or POST vars contain same var twice
body: <p>It may sound strange, but in my PHP application I need to check if the same variable name has been declared more than once in the query string or POST variables, and return an error value if this is the case.  If my application doesn't return an error in this case, it fails a compliance check.</p>
  
  <p>When accessing vars using $_GET, $_POST, etc, PHP only returns the last value given for each variable name.  I can't find a way to tell if any variable appeared more than once.</p>
  
  <p>I simply need to find out if the query string or the variables in the POST body contained the same variable name more than once, whatever the values.</p>
  
  <p><strong>Example</strong></p>
  
  <p>My application is supposed to return an error for this query string:</p>
  
  <pre><code>verb=ListIdentifiers&amp;metadataPrefix=oai_dc&amp;metadataPrefix=oai_dc
  </code></pre>
  
  <p>Note that "metadataPrefix" is defined twice.</p>
  
  <p>My application should not return an error for this query string:</p>
  
  <pre><code>verb=ListIdentifiers&amp;metadataPrefix=oai_dc
  </code></pre>