How to group by in php?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2189626/php-how-to-group-a-multidimensional-array-by-a-particular-value">php how to group a multidimensional array by a particular value?</a>  </p>
</blockquote>



<p>I have a sample code:</p>

<pre><code>name        |   images        | brand   | brand_parent
windows 7   | 7_1.png,7_2.png | Vostro  |   DELL
windows 7   | 7_1.png,7_2.png | Inspison|   DELL
windows 7   | 7_1.png,7_2.png | Compaq  |   HP     
windows 7   | 7_1.png,7_2.png | Macbook |   Apple

$name=array();$images=array();$brand=array();$brand_parent=array();
foreach ($rows as $row) {
    $name[] = $row-&gt;name;
    $images[] = $row-&gt;images;
    $brand[] = $row-&gt;brand;
    $brand_parent[] = $row-&gt;brand_parent;
}
</code></pre>

<p>How to group by column name, images with this code</p>
