I have some comments from customers, and I want to sort them by popularity. I can put them in an array to count each comment, but I want to order the comments by said count, how is this achieved?
I can make the arrays like this:
$arr['comment1'] = 4;
$arr['comment2'] = 2;
$arr['comment3'] = 6;
Or
$arr[] = array('comment'=>'comment1','count'=>4);
$arr[] = array('comment'=>'comment2','count'=>2);
$arr[] = array('comment'=>'comment3','count'=>6);
So I would like to re-order the array into this order - comment3, comment1, comment2 - i.e. in order of count. Is this possible?