<?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 Id, agent_id, fio FROM agentlar");

$response = array();

while($row = mysqli_fetch_assoc($query)){

        $Id=$row['Id'];
        $agent_id=$row['agent_id'];
		$nomi=$row['fio'];

		$nomi = str_replace('"', '`', $nomi);

    array_push($response,
    array(
            'Id' => $Id,
            'agent_id' => $agent_id,
            'fio' => $nomi
         )
        );
}

echo json_encode($response);

?>
