title: php combine keys with values in associative multidimensional array
body: <p>I'm trying to manipulate an associative multidimensional array. I've extracted the keys from an array that I want to apply to another's values . . . </p>
  
  <p>These are the keys that I've extracted in another function</p>
  
  <pre><code>$keys = array (
      "id" =&gt; "id",
      "addr_street_num" =&gt; "addr_street_num",
      "addr_street" =&gt; "addr_street",
      "price" =&gt; "price",
      "days" =&gt;"days",
      "state" =&gt; Array
          (
              "id" =&gt; "id",
              "name" =&gt; "name"
          ),
  
      "city" =&gt; Array
          (
              "id" =&gt; "id",
              "web_id" =&gt; "web_id",
              "name" =&gt; "name"
          )
  );
  </code></pre>
  
  <p>This array has the values I'd like to combine together</p>
  
  <pre><code>$vals = array (
      "0" =&gt; "830680",
      "1" =&gt; "20",
      "2" =&gt; "Sullivan Avenue",
      "3" =&gt; "333000",
      "4" =&gt; "12",
      "5" =&gt; Array
          (
               "0" =&gt; "4",
               "1" =&gt; "Maryland",
          ),
  
      "6" =&gt; Array
          (
              "0" =&gt; "782",
              "1" =&gt; "baltimore",
              "2" =&gt; "Baltimore",
          )
  );
  </code></pre>
  
  <p>When I try to do array_combine($keys, $val);
  I get 2 Notices about Array to string conversion</p>
  
  <p>I guess array_combine only works on one dimensional arrays, any ideas on how to approach this?</p>
  
  <p>If $keys was modified could it be combined with the values - problem is the shape of $keys is what I want to end up with?</p>