All pastes #563237 Raw Edit

Alex

public text v1 · immutable
·published 2007-06-13 01:38 UTC
rendered paste body
Process for getting top 10 for each field


//get uids of all friends
//Call MySQL fields for all friends
//explode strings by commas
//merge arrays

$count = array();
//foreach element:
foreach( $arr as $val )
   //add 1 to the hash of that element(no idea how):
   $count[$val]++;
//sort desc:
arsort($count);
//chop of everything but top 10:
array_slice($count, 0, 10);
//display