I have an array looking like this:
Array(
['some_first_category'] => Array(
['some_first_name'] => Array(
[0]=>'first@email.com',
[1]=>'second@email.com',
[2]=>'third@email.com',
[3]=>'fourth@email.com' )
['some_second_name'] => Array (
[1]=>'first@email.com',
[2]=>'second@email.com')
['some_third_name'] => Array(
[1]=>'first@email.com',
[2]=>'second@email.com',
[3]=>'third@email.com',
[4]=>'fourth@email.com' )
['some_second_category'] => Array(
['some_first_name'] => Array(
[0]=>'first@email.com' )
['some_second_name'] => Array(
[1]=>'first@email.com',
[2]=>'second@email.com',
[3]=>'third@email.com',
[4]=>'fourth@email.com')
['some_third_name'] => Array(
[1]=>'first@email.com',
[2]=>'second@email.com'))
And I want to sort the array by the number of values of that has the names, In my case I want to become this array:
Array(
['some_first_category'] => Array(
['some_third_name'] => Array(
[1]=>'first@email.com',
[2]=>'second@email.com',
[3]=>'third@email.com',
[4]=>'fourth@email.com' )
['some_first_name'] => Array(
[0]=>'first@email.com',
[1]=>'second@email.com',
[2]=>'third@email.com',
[3]=>'fourth@email.com' )
['some_second_name'] => Array (
[1]=>'first@email.com',
[2]=>'second@email.com')
['some_second_category'] => Array(
['some_second_name'] => Array(
[1]=>'first@email.com',
[2]=>'second@email.com',
[3]=>'third@email.com',
[4]=>'fourth@email.com')
['some_third_name'] => Array(
[1]=>'first@email.com',
[2]=>'second@email.com')
['some_first_name'] => Array(
[0]=>'first@email.com' ))
This means sorting categories by name by the number(count) of values of the names. Someone can help me? Thanks in advance,
Aäron