4 function array_sort($array, $on, $order=SORT_ASC
) {
6 $sortable_array = array();
7 if (count($array) > 0) {
8 foreach ($array as $k => $v) {
10 foreach ($v as $k2 => $v2) {
12 $sortable_array[$k] = $v2;
16 $sortable_array[$k] = $v;
22 asort($sortable_array);
25 arsort($sortable_array);
29 foreach ($sortable_array as $k => $v) {
30 $new_array[$k] = $array[$k];
38 echo "Be Messaging Monitoring System".PHP_EOL
;
41 $dir = file(DB_PATH
."idlist.log");
42 foreach($dir as $key){
43 $array[0] = explode("<><>", $key);
44 $worldofArray['directory'] = $inbox->loggedEmail($array[0][1], MDB_PATH
);
45 $worldofArray['id'] = $array[0][0];
46 if(is_dir($worldofArray['directory'])){
48 $hi = explode("/", $worldofArray['directory']);
49 $strReplaced = trim($array[0][1]);
51 foreach (glob($worldofArray['directory']."*.dat") as $filename){
54 $arrayContainer[] = array('directory' => $worldofArray['directory'], 'id' => $worldofArray['id'], 'conversation_count' => $count, 'email' => $strReplaced );
57 $arrayContainer= array_sort($arrayContainer, 'conversation_count', SORT_DESC
);
58 $returned = array_values($arrayContainer);
59 for ($i=0; $i < 10; $i++
) {
60 if(isset($returned[$i]))
61 echo "{$returned[$i]['id']}|| {$returned[$i]['email']} || {$returned[$i]['conversation_count']}".PHP_EOL
;