I am returning a JSON encoded array: echo(json_encode($data)); from php and I would like it to populate the suggest box from JQuery autocomplete. I\'m using thi
the proper json format for this from php:
From js wich means []-array of {} objects.
In my case for autocomlete widjet this works fine:
$response="[";
while($row = $res->fetch_assoc()){
if($response !="[")$response.=",";
$response.='{"label":"'.$row["fio"].'","value":"'.$row["id"].'"}';
}
$response.="]";
echo $response;