I have a an array:

```
Array
(
    [0] => Array
        (
            [id] => 53
            [product] => something
            [price] =>  £78
            [quantity] => 23
            [time] => 2011-07-15 20:29:21
        )

    [1] => Array
        (
            [id] => 52
            [product] => product
            [price] => £89
            [quantity] => 1
            [time] => 2011-07-14 00:51:57
        )

    [2] => Array
        (
            [id] => 51
            [product] => product
            [price] => £89
            [quantity] => 1
            [time] => 2011-07-14 00:51:37
        ))

```

I got this using the following sql statement:

```
select * from some_table GROUP BY time DESC

```

I want to display the results ordered by date, with the date as a heading:

e.g. 

```
**2011-07-15**
all array elements for above date go here

**2011-07-15**
all array elements for above date go here

```

I thought about doing a seperate statement for each seperate day, but that sounds wrong. Is there a better way?