(int)($o['tg'] ?? 0), 'name' => (string)($o['name'] ?? ''), 'system' => (string)($o['system'] ?? ''), 'allstar' => (string)($o['allstar'] ?? ''), 'mode' => (string)($o['mode'] ?? ''), ]; } } } usort($tgs, fn($a, $b) => $a['tg'] <=> $b['tg']); header('Content-Type: application/json; charset=utf-8'); header('Cache-Control: public, max-age=60'); echo json_encode(['ok' => true, 'count' => count($tgs), 'tgs' => $tgs], JSON_UNESCAPED_SLASHES);