'; $activators = array(); foreach ($activators_array as $line) { $call = $line->call; $grids = $line->grids; $count = $line->count; if (array_key_exists($line->call, $vucc_grids)) { foreach(explode(',', $vucc_grids[$line->call]) as $vgrid) { if(!strpos($grids, $vgrid)) { $grids .= ','.$vgrid; } } $grids = str_replace(' ', '', $grids); $grid_array = explode(',', $grids); sort($grid_array); $count = count($grid_array); $grids = implode(', ', $grid_array); } $activators[] = (object) array( 'count' => $count, 'call' => $call, 'grids' => $grids, ); } usort($activators, function ($left, $right) { if ($left->count === $right->count) { return strcmp($left->call, $right->call); } return $right->count <=> $left->count; }); foreach ($activators as $line) { echo ''; } echo '
# ' . lang('gen_hamradio_callsign') . ' ' . lang('general_word_count') . ' ' . lang('gridsquares_gridsquares') . ' ' . lang('gridsquares_show_qsos') . ' ' . lang('gridsquares_show_map') . '
' . $i++ . ' '.$line->call.' '.$line->count.' '.$line->grids.'
'; } write_activators($activators_array, $vucc_grids, $custom_date_format, $band, $leogeo);