title: Merging arrays of different lengths
body: <p>Given 2 arrays of the following formats:</p>
  
  <pre><code>$array1 = array("1", "2", "3", "4", "5");
  
  $array2 = array(
    0 =&gt; array("start" =&gt; "09:00", "end" =&gt; "17:00"),
    1 =&gt; array("start" =&gt; "18:00", "end" =&gt; "20:00")
  );
  </code></pre>
  
  <p>I need to merge so that the result is:</p>
  
  <pre><code>$result = array(
    array(
      "start_day" =&gt; "1",
      "start_time" =&gt; "09:00",
      "end_day" =&gt; "1",
      "end_time" =&gt; "17:00"
    ),
    array(
      "start_day" =&gt; "1",
      "start_time" =&gt; "18:00",
      "end_day" =&gt; "1",
      "end_time" =&gt; "20:00"
   )
   // and so on for each item in $array1
  );
  </code></pre>
  
  <p>Both arrays can be of varying lengths but each item in $array2 must be applied to an item in $array1. Just throwing this out there to see if anyone has any experience with this sort of merge. My current solution only gives me a result array with a length that equals the length of $array2. Working on this now but any insight would be appreciated!</p>