I looked quite a bit around (like here the array-sort-comparisons), and tried to figure out how to sort (or reverse) my multiple-elements array. But in vain.
I have three elements in my array, and want to sort the it by "year" ASC:
array(52) {
[0]=>
array(3) {
["id"]=>
string(2) "SI"
["year"]=>
string(4) "2012"
["value"]=>
string(7) "3711339"
}
[1]=>
array(3) {
["id"]=>
string(2) "SI"
["year"]=>
string(4) "2011"
["value"]=>
string(7) "3810626"
}
[2]=>
array(3) {
["id"]=>
string(2) "SI"
["year"]=>
string(4) "2010"
["value"]=>
string(7) "3714946"
}
How would that be possible? Somehow one needs to be able to specify which of the three elements is the "key" to be the basis of the sorting.
Thanks for any hints!