<?php

// Created by Mr. Developer on 15.09.2020
 

require_once('connect.php');

$javob = mysqli_query($conn,"SET NAMES utf8"); 
$query = mysqli_query($conn, "SELECT gruppa_id, gruppa_nomi FROM gruppa");

$response = array();

while($row = mysqli_fetch_assoc($query)){
    
    $gruppa_id=$row['gruppa_id']; 
	$nomi=$row['gruppa_nomi']; 
		
	$nomi = str_replace('"', '`', $nomi); 
    
    array_push($response,
    array(
            'gruppa_id' => $gruppa_id,
            'gruppa_nomi' => $nomi
         )
        );
}

echo json_encode($response);

?>

