title: PHP Multiple arrays in foreach loop
body: <p>I need to somehow get two arrays in one foreach loop (Because two loops would mess it up). The two arrays is selected from my database. As you can see in the var_dump down below, then there are the same values, I do not know is this is going to be a problem?</p>
  
  <p>Code:</p>
  
  <pre><code>$getUserWorks       = $work-&gt;getUserWorks($userInfo-&gt;id);
  $getUserMachines    = $work-&gt;getUserMachines($userInfo-&gt;id);
  
  foreach(???){
  ?&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;
                                      &lt;?php echo $array-&gt;orderid; ?&gt;
                                  &lt;/td&gt;
                                  &lt;td&gt;
                                       &lt;?php echo $array-&gt;work_hours; ?&gt;
                                  &lt;/td&gt;
                                  &lt;td&gt;
                                      &lt;?php 
                                      echo $array-&gt;machinename;
                                      ?&gt;
                                  &lt;/td&gt;
                                  &lt;td&gt;
                                      &lt;?php echo $array-&gt;machine_hours; ?&gt;
                                  &lt;/td&gt;
                                  &lt;td&gt;
  
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;/tbody&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>Var_dump of the two arrays:</p>
  
  <pre><code>array (size=1)
    0 =&gt; 
      object(stdClass)[11]
        public 'id' =&gt; string '2' (length=1)
        public 'orderid' =&gt; string '4' (length=1)
        public 'userid' =&gt; string '8' (length=1)
        public 'work_hours' =&gt; string '4' (length=1)
        public 'timestamp' =&gt; string '2015-06-28 12:48:34' (length=19)
  
  array (size=1)
    0 =&gt; 
      object(stdClass)[7]
        public 'id' =&gt; string '2' (length=1)
        public 'orderid' =&gt; string '4' (length=1)
        public 'userid' =&gt; string '8' (length=1)
        public 'workid' =&gt; string '2' (length=1)
        public 'machineid' =&gt; string '1' (length=1)
        public 'machinename' =&gt; string 'test' (length=4)
        public 'machine_hours' =&gt; string '4' (length=1)
        public 'timestamp' =&gt; string '2015-06-28 12:48:34' (length=19)
  </code></pre>