I have the following PHP code which pulls the data form mysql (unicode entries)
$conn = mysqli_connect("localhost", "root", "", "mapping") or die ("Error".mysqli_error($conn));
mysqli_set_charset($conn,"utf8");
$sql = "select * from villages";
$result = mysqli_query($conn, $sql) or die ("error" . mysqli_error($conn));
$myArray = array();
while($row = mysqli_fetch_assoc($result)){
$myArray[] = $row;
}
mysqli_close($conn);
echo json_encode($myArray, JSON_UNESCAPED_UNICODE);
?>
$myArray[0] is:
{"id":"1","village":"अकबरपुर","villageEn":"akbarpur","subdiv":"हुजूर","tehsil":"हुजूर","ricircle":"रातीबढ़","patwarih":"अकबरपुर"}
When I do console.log() all the array items are shown in at once, what I want is to view them as objects[javascript (aka JSON)] in browser devtools