title: Php foreach loop combine two values
body: <p>I the following example:</p>
  
  <pre><code>Array
  (
      [0] =&gt; stdClass Object
          (
              [user_id] =&gt; 8
              [users] =&gt; 1
          )
  
      [1] =&gt; stdClass Object
          (
              [user_id] =&gt; 8
              [users] =&gt; 18,19
          )
  
  )
  </code></pre>
  
  <p>I need to run foreach loop and end up with something like:</p>
  
  <pre><code>Array
  (
      [0] =&gt; stdClass Object
          (
              [user_id] =&gt; 8
              [users] =&gt; 1,8
          )
  
      [1] =&gt; stdClass Object
          (
              [user_id] =&gt; 8
              [users] =&gt; 18,19,8
          )
  
  )
  </code></pre>
  
  <p>So that [user_id] and [users] are combined into [users]</p>