tags:

views:

90

answers:

2

Hai guys,

I want to convert my result array to json format in php... Here is my code

$row = mysql_fetch_array($result)

Now i want to convert $row to json format... I want to pass the json data to autocomplete plugin of jquery....

+1  A: 

json_encode is available in php > 5.2.0:

echo json_encode($row);

jspcal
@jspcal i ll give a try
chandru_cp
A: 

And if you have a version older than 5.2.0 then you can use any number of JSON encoding/decoding libraries. I think http://www.json.org/ has a list somewhere.

sberry2A