我正在尝试从我的数据库中获取数据并将它们转换为 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!\"}]"
- 我应该看到实际的标题吗?
- 双引号这样转义是否正常?
- 整个事情应该以文件的形式出现吗?foo.json?
- 你知道如何正确地将 Doctrine Entity 转换为 JSON 吗?