0

我有以下 json,由于下面的 json,它无效,我需要将其设为字符串才能在 json 上有效。关于在 php 中执行此操作的最佳方法的任何建议?

{
    29646191: [
        "https://www.facebook.com/RobertScoble/posts/480030845352725",
        "https://sphotos-a.xx.fbcdn.net/hphotos-prn1/s480x480/546943_10151235934049655_1771118951_n.jpg",
        "Today I tried... | Facebook",
        "Robert Scoble wrote: Today I tried something. I paid $49 and... Join Facebook to connect with Robert Scoble and others you may know.",
        null,
        [
            "//images3-focus-opensocial.googleusercontent.com/gadgets/proxy?url\u003dhttps://sphotos-a.xx.fbcdn.net/hphotos-prn1/s480x480/546943_10151235934049655_1771118951_n.jpg\u0026container\u003dfocus\u0026gadget\u003da\u0026rewriteMime\u003dimage/*\u0026refresh\u003d31536000\u0026resize_h\u003d150\u0026resize_w\u003d150\u0026no_expand\u003d1",
            150,
            150,
            null,
            null,
            null,
            null,
            null,
            [
                3,
                "https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url\u003dhttps://sphotos-a.xx.fbcdn.net/hphotos-prn1/s480x480/546943_10151235934049655_1771118951_n.jpg\u0026container\u003dfocus\u0026gadget\u003dhttps://plus.google.com\u0026rewriteMime\u003dimage/*\u0026resize_h\u003d800\u0026resize_w\u003d800\u0026no_expand\u003d1"
            ]
        ],
        "//s2.googleusercontent.com/s2/favicons?domain\u003dwww.facebook.com",
        [],
        null,
        []
    ]
}
4

1 回答 1

1

让浏览器为您完成。

var x = {
    29646191: [
        "https://www.facebook.com/RobertScoble/posts/480030845352725",
        "https://sphotos-a.xx.fbcdn.net/hphotos-prn1/s480x480/546943_10151235934049655_1771118951_n.jpg",
        "Today I tried... | Facebook",
        "Robert Scoble wrote: Today I tried something. I paid $49 and... Join Facebook to connect with Robert Scoble and others you may know.",
        null,
        [
            "//images3-focus-opensocial.googleusercontent.com/gadgets/proxy?url\u003dhttps://sphotos-a.xx.fbcdn.net/hphotos-prn1/s480x480/546943_10151235934049655_1771118951_n.jpg\u0026container\u003dfocus\u0026gadget\u003da\u0026rewriteMime\u003dimage/*\u0026refresh\u003d31536000\u0026resize_h\u003d150\u0026resize_w\u003d150\u0026no_expand\u003d1",
            150,
            150,
            null,
            null,
            null,
            null,
            null,
            [
                3,
                "https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url\u003dhttps://sphotos-a.xx.fbcdn.net/hphotos-prn1/s480x480/546943_10151235934049655_1771118951_n.jpg\u0026container\u003dfocus\u0026gadget\u003dhttps://plus.google.com\u0026rewriteMime\u003dimage/*\u0026resize_h\u003d800\u0026resize_w\u003d800\u0026no_expand\u003d1"
            ]
        ],
        "//s2.googleusercontent.com/s2/favicons?domain\u003dwww.facebook.com",
        [],
        null,
        []
    ]
}

JSON.stringify(x);

"{"29646191":["https://www.facebook.com/RobertScoble/posts/480030845352725","https://sphotos-a.xx.fbcdn.net/hphotos-prn1/s480x480/546943_10151235934049655_1771118951_n.jpg" “今天我尝试了... | Facebook","Robert Scoble 写道:今天我尝试了一些东西。我支付了 49 美元,然后... 加入 Facebook,与 Robert Scoble 和您可能认识的其他人联系。",null,["//images3-focus-opensocial.googleusercontent.com/gadgets/proxy?url=https://sphotos- a.xx.fbcdn.net/hphotos-prn1/s480x480/546943_10151235934049655_1771118951_n.jpg&container=focus&gadget=a&rewriteMime=image/*&refresh=31536000&resize_h=150&resize_w=150&resize_w=150,null,150&no_expand,null=1,null,050&no_expand,null=1,null,null,150&no_expand,null ”https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url=https://sphotos-a.xx.fbcdn。

于 2012-11-09T06:26:34.520 回答