I have a php to return data to ajax callback.
if((isset($_GET['keyword'])) && (strlen($_GET['keyword']) > 3)){
$query = "SELECT * FROM bin";
$result = $db->run_query($conn,$query);
while ($rows = mysqli_fetch_array($result,MYSQLI_NUM)){
$data[] = $rows;
}
echo json_encode($data);
}
But when I log it result from it, my data is array of array. I want my return data is array of object.
How to do it? Thanks.