Grouping and sorting an array
<p>I have an array </p>

<pre><code>Array

(

    [0] =&gt; Array
        (
            [sub] =&gt; 
            [OWNER] =&gt; owner1 
            [cnt] =&gt; 0
            [ST_STATUS] =&gt; 
        )

    [1] =&gt; Array
        (
            [sub] =&gt; 
            [OWNER] =&gt; owner1 
            [cnt] =&gt; 3675
            [ST_STATUS] =&gt; No Run
        )

    [2] =&gt; Array
        (
            [sub] =&gt; 
            [OWNER] =&gt; owner2
            [cnt] =&gt; 416
            [ST_STATUS] =&gt; No Run
        )

    [3] =&gt; Array
        (
            [sub] =&gt; 
            [OWNER] =&gt; owner3
            [cnt] =&gt; 273
            [ST_STATUS] =&gt; No Run
        )

    [4] =&gt; Array
        (
            [sub] =&gt; 10/1/2011 
            [OWNER] =&gt; owner2
            [cnt] =&gt; 14
            [ST_STATUS] =&gt; No Run
        )

    [5] =&gt; Array
        (
            [sub] =&gt; 10/10/2011
            [OWNER] =&gt; owner3
            [cnt] =&gt; 1
            [ST_STATUS] =&gt; Failed
        )

    [6] =&gt; Array
        (
            [sub] =&gt; 10/10/2011
            [OWNER] =&gt; owner3
            [cnt] =&gt; 11
            [ST_STATUS] =&gt; No Run
        )

}
</code></pre>

<p>I want to group an array by OWNER FIELD that is i should return an array which is grouped</p>

<p>by OWNER </p>

<p>values .
like this </p>

<pre><code>array( [0] =&gt; Array

        (

            [sub] =&gt; 
            [OWNER] =&gt; owner1 
            [cnt] =&gt; 0
            [ST_STATUS] =&gt; 
        ),


 [1] =&gt; Array

        (

            [sub] =&gt; 
            [OWNER] =&gt; owner1 
            [cnt] =&gt; 0
            [ST_STATUS] =&gt; 
        )

 [2] =&gt; Array
        (


            [sub] =&gt; 
            [OWNER] =&gt; owner1 
            [cnt] =&gt; 0
            [ST_STATUS] =&gt; 
        ),



 [3] =&gt; Array
        (
            [sub] =&gt; 
            [OWNER] =&gt; owner2 
            [cnt] =&gt; 0
            [ST_STATUS] =&gt; 
        ),


 [4] =&gt; Array
        (
            [sub] =&gt; 
            [OWNER] =&gt; owner2 
            [cnt] =&gt; 0
            [ST_STATUS] =&gt; 
        )
</code></pre>
