<?php
include_once "ChatConfig.php";
$stmt = $connection->query("SELECT id  from group_$_POST[group]");
$result = $stmt->fetchAll(PDO::FETCH_OBJ);
$ids = array_map(function($v){
    return $v->id;
}, $result);

echo json_encode($ids);