<?php 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);  
include_once 'db_functions.php';
$state = $_REQUEST["state"];
$db = new DB_Functions();     
$users = $db->getCityMaster($state);     
$a = array();     
$b = array();    
if ($users != false){         
while ($row = mysqli_fetch_array($users)) 
{                     
$b["id"] = $row["id"];
$b["state"] = $row["state"];
$b["city"] = $row["city"];
$b["country"] = $row["country"];
       
array_push($a,$b);         
}         
echo json_encode($a);     
} 
?>