0

我正在尝试从我的数据库中获取数据并将它们转换为 JSON (Symfony2) 这是我在访问 json 页面时得到的回复:

HTTP/1.0 200 OK Cache-Control: no-cache Content-Type: application/json Date: Mon, 11 Feb 2013 15:05:03 GMT "[{\"id\":1,\"iam\":1,\"youare\":2,\"lat\":50.8275853,\"lng\":4.3809764,\"msgbody\":\"I saw you over there what's up!\"},{\"id\":2,\"iam\":1,\"youare\":2,\"lat\":50.8275853,\"lng\":4.3809764,\"msgbody\":\"I saw you over there what's up!\"},{\"id\":3,\"iam\":1,\"youare\":2,\"lat\":50.8275853,\"lng\":4.3809764,\"msgbody\":\"I saw you over there what's up!\"},{\"id\":4,\"iam\":1,\"youare\":2,\"lat\":50.8275853,\"lng\":4.3809764,\"msgbody\":\"I saw you over there what's up!\"},{\"id\":5,\"iam\":1,\"youare\":2,\"lat\":50.8275853,\"lng\":4.3809764,\"msgbody\":\"I saw you over there what's up!\"},{\"id\":6,\"iam\":1,\"youare\":2,\"lat\":50.8275853,\"lng\":4.3809764,\"msgbody\":\"I saw you over there what's up!\"}]"
  1. 我应该看到实际的标题吗?
  2. 双引号这样转义是否正常?
  3. 整个事情应该以文件的形式出现吗?foo.json?
  4. 你知道如何正确地将 Doctrine Entity 转换为 JSON 吗?
4

1 回答 1

0

您必须为您的浏览器下载 json 插件。就像我使用 chrome json 插件 https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc?hl=en

于 2013-04-25T12:20:54.873 回答