Combine Objects Values with same Ids
<p>Not sure how to word this but here goes.</p>

<p>I have an object $full. That contains a user id and a users image. If a user uploads more then one image I would like to out put them together. Issue is that multiple users upload at different times and the obj contains all the uploaded information sorted by date:</p>

<pre><code>$full = array_merge($array, $arr);
$dates = array();
foreach($full as $key=&gt;$row) {
    $dates[$key] = $row-&gt;up_date;
}

array_multisort($dates, SORT_DESC, $full);
</code></pre>

<p>Example OBJ</p>

<pre><code>$full-&gt;id
$full-&gt;id-&gt;user_id
$full-&gt;id-&gt;filename
</code></pre>

<p>So what I am trying to accomplish is as follows:</p>

<p>Output</p>

<p>if 2 > $full user count</p>

<pre><code>&lt;div&gt;&lt;img src="" /&gt;&lt;/div&gt;
</code></pre>

<p>if 2 =&lt; $full user count</p>

<pre><code>&lt;div&gt;&lt;img src="" /&gt;&lt;img src="" /&gt;&lt;/div&gt;
</code></pre>

<p>So if the user_id exists again output the image in the same div. If not create a new div. I just can't seem to figure out how to combine the values that have the same parent - user_id.</p>
