Here is my code:
<?php
while ($row = mysqli_fetch_assoc($searching_user))
{
$salon_name = ucfirst($row['service_name']);
$salon_id = ucfirst($row['id']);
$salon_address = ucwords($row['address']);
$salon_area = ucwords($row['area']);
$salon_city = ucwords($row['city']);
$salon_specialty = ucwords($row['specialty']);
$img = $row['image_url'];
$response["error"] = FALSE;
$response["service_name"] = $salon_name;
echo json_encode($response);
}
?>
after this I'm getting the response in this format
{"error":false,"service_name":"Mike salon"}{"error":false,"service_name":"Michel salon"} {"error":false,"service_name":"Michel salon"}{"error":false,"service_name":"Mike Salon"} {"error":false,"service_name":"Etta Salon"}
I simply want this response like this
[ {"error":false,"service_name":"Mike salon"},{"error":false,"service_name":"Michel salon"},{"error":false,"service_name":"Michel salon"},{"error":false,"service_name":"Mike Salon"}, {"error":false,"service_name":"Etta Salon"}]
Kindly help me to get a proper response form for json . Thanks