<?php

// Created by Ilhomjon on 06.03.2021


        require_once('connect.php');

        mysqli_set_charset($conn,"utf8");
        $query = mysqli_query($conn,"SET NAMES utf8");

        $query = mysqli_query($conn, "SELECT Id, region_id, region_nomi FROM regionlar");

        $list_region = array();

        if ($query !== false && $query->num_rows > 0) {

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

                $region_id=$row['region_id'];
                $nomi=$row['region_nomi'];
            	$nomi = str_replace('"', '`', $nomi);

            array_push($list_region,
            array(
                    'region_id' => $region_id,
                    'region_nomi' => $nomi
                 )
                );
        }


        }



    echo json_encode($list_region);
 $conn->close();

?>
