I have a multidimensional array like

```
At index 0  
           mset =3
           rating=5
At index 1 
           mset=4
           rating=8
At index 2
           mset=4
           rating=9
At index 3
           mset=5 
           rating=3

```

....I have to sort the array like this first mset =4 then mset=3 with rating>=4 then mset=5 then mset=3 with rating <4. Also that within each mset descending order of rating should be followed like as we have to first display mset =4 but first index=2 should be displayed as its rating is 9 which is greater then rating=8 at index=1. Please provide me a function to sort this array as desired..thanks in advance