
<?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, region_id, region_nomi FROM regionlar");

$response = array();

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

echo json_encode($response);

?>
