1
I have the following array():
$retorno[] = array(
"mes"=>$r1[3],
"ano"=>$r1[4],
"valor"=>$r1[2],
"codsubcategoria"=>$r1[6]
);
That in the var_dump()
I have the following return, for example:
[0]=>
array(4) {
["mes"]=>
string(1) "9"
["ano"]=>
string(4) "2019"
["valor"]=>
string(5) "30.75"
["codsubcategoria"]=>
string(1) "4"
}
[1]=>
array(4) {
["mes"]=>
string(2) "10"
["ano"]=>
string(4) "2019"
["valor"]=>
string(5) "30.75"
["codsubcategoria"]=>
string(1) "4"
}
[2]=>
array(4) {
["mes"]=>
string(2) "10"
["ano"]=>
string(4) "2019"
["valor"]=>
string(6) "325.00"
["codsubcategoria"]=>
string(1) "5"
}
[3]=>
array(4) {
["mes"]=>
string(1) "9"
["ano"]=>
string(4) "2019"
["valor"]=>
string(6) "325.00"
["codsubcategoria"]=>
string(1) "5"
}
[4]=>
array(4) {
["mes"]=>
string(1) "9"
["ano"]=>
string(4) "2019"
["valor"]=>
string(5) "23.00"
["codsubcategoria"]=>
string(1) "3"
}
Note that in the key "month" there are months of September and October mixed. I wanted to order this return according to year and month. I tried with asort(), rsort(), but it didn’t work.
If you can help me.
thanks, it worked out was what I needed. Thank you
– LeoZera