usort($array, 'my_sort_function');
var_dump($array);
function my_sort_function($a, $b)
{
return $a->name < $b->name;
}
The same code will be with the count
field.
More details about usort
: http://ru2.php.net/usort
Btw, where did you get that array from? I hope that not from database?