title: How to assign indexed array values to multidimensional array?
body: <p>I'd like to replace the values of a multidimensional array with the values of a simple numerically indexed array. The number of values in each array is equal, but they do not have the same keys/indexes due to different array structure.</p>
  <p>I had a working solution using <code>array_combine</code>, iteration, and a hashtable but cannot recreate my work. I've tried <code>array_merge</code>, <code>array_combine</code>, and looping through the arrays.</p>
  <pre><code>$venue_ids = array( 
      0 =&gt; array(
          0 =&gt; 2476 ), 
          1 =&gt; array( 
              0 =&gt; 2482,
              1 =&gt; 2480,
              2 =&gt; 2463 ),
          2 =&gt; array( 
              0 =&gt; 2484,
              1 =&gt; 2476,
              2 =&gt; 2486,
              3 =&gt; 2463 ));
  
  $names = array( 
      0 =&gt; 'clubhouse',
      1 =&gt; 'campground',
      2 =&gt; 'lake',
      3 =&gt; 'range',
      4 =&gt; 'trfields',
      5 =&gt; 'clubhouse',
      6 =&gt; 'trfields',
      7 =&gt; 'range' );
  </code></pre>
  <p>I'd like the result to keep the structure of the first array, and simply substitute its values with those from the second. It should look like this:</p>
  <pre><code>$venues = array( 
      0 =&gt; array( 
          0 =&gt; 'clubhouse' ), 
      1 =&gt; array( 
          0 =&gt; 'campground',
          1 =&gt; 'lake',
          2 =&gt; 'range' ),
      2 =&gt; array( 
          0 =&gt; 'trfields',
          1 =&gt; 'clubhouse',
          2 =&gt; 'trfields',
          3 =&gt; 'range' ));
  </code></pre>
  <p>The configuration of <code>$venue_ids</code> will change, including the number of indexes and number of keys/values therein, but there will always be a matching 1-to-1 number of <code>$names</code>. I'd be happy just replacing values or constructing a whole new array matching the structure of <code>$venues_id</code> and working with that.</p>