I intend to generate JSON that's like this:
{ "stores": [{"Name":"abc","Phone","1234567"},{"Name":"def","Phone","1111111"}], "numResults": 2 }
My php code is like this:
while($row = mysql_fetch_assoc($result)){
$store[] = $row;
$k++;
}
$obj['stores'] = json_encode($store);
$obj['numResult'] = $numResult;
echo stripslashes(json_encode($obj));
However the result seems to have an extra pair of double quotes around the square brackets:
{ "stores": "[{"Name":"abc","Phone","1234567"},{"Name":"def","Phone","1111111"}]", "numResults": 2 }
How can I remove them? (Or is what's actually showing suppose to be the correct JSON formatting?)
Thanks!