title: PHP Associative Array Duplicate Keys
body: <p>I have an associative array, however when I add values to it using the below function it seems to overwrite the same keys. Is there a way to have multiple of the same keys with different values? Or is there another form of array that has the same format?</p>
  
  <p>I want to have:</p>
  
  <pre><code>42=&gt;56
  42=&gt;86
  42=&gt;97
  51=&gt;64
  51=&gt;52
  etc etc
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>   function array_push_associative(&amp;$arr) {
         $args = func_get_args();
         foreach ($args as $arg) {
             if (is_array($arg)) {
                 foreach ($arg as $key =&gt; $value) {
                     $arr[$key] = $value;
                     $ret++;
                 }
             }else{
                 $arr[$arg] = "";
             }
         }
         return $ret;
      }
  </code></pre>