Is there a way to sort an array of associative arrays by the length of one of the elements? What I am trying to do is order the arrays by the largest to smallest description length.
$some_array = [];
$some_array[0] = ['name'=>'a name','description'=>'a description'];
$some_array[1] = ['name'=>'a name1','description'=>'a description 1'];
$some_array[2] = ['name'=>'a name2','description'=>'a description two for the third array element'];
$some_array[3] = ['name'=>'a name3','description'=>'a description three'];
With the above example $some_array[2]
should come first followed by 3
then 1
then 0
.