I am fetching records from database which returns an array as follows:
Array
(
[0] => stdClass Object
(
[id] => 2
[name] => ravi
[text] => hey
[date] => 2011-05-1
)
[1] => stdClass Object
(
[id] => 3
[name] => shiv
[text] => bye
[date] => 2011-04-29
)
[2] => stdClass Object
(
[id] => 4
[name] => adi
[text] => hello
[date] => 2011-04-30
)
)
How to sort this based on the date element?