I try to find any solution with sort multi-dimensional arrays, but don't see anything match my requirement.
Here is my example that I want.
I want to sort below array by "views" DESC
$arr = array(
0=>array(
'id'=>11,
'views'=>10,
'title'=> 'html'
),
1=>array(
'id'=>12,
'views'=>4,
'title'=> 'Java'
),
2=>array(
'id'=>13,
'views'=>100,
'title'=> 'Boostrap'
)
);
to
$arr = array(
0=>array(
'id'=>13,
'views'=>100,
'title'=> 'Boostrap'
),
1=>array(
'id'=>11,
'views'=>10,
'title'=> 'html'
),
2=>array(
'id'=>12,
'views'=>4,
'title'=> 'Java'
)
);
without loop in php.
How can I do this.