I have an array looking like this:
Array( [\'some_first_category\'] => Array( [\'some_first_name\'] => Array(
You should use usort function. Refer here.
function sort_sub($a,$b) { $res= count($b)-count($a); return $res; } usort($array_name,'sort_sub')