0

JSON 显然看起来像这样。

    {\"amount\":10,\"conversion_id\":\"5145fd4e04af9\",\"extra_params\":
    {\"ip\":\"99.237.185.67\",\"user_agent\":\"Mozilla/5.0 (Windows NT 6.1; WOW64) 
    AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 
    Safari/537.11\"},\"job_title\":\"Answer a few questions about a website (Canada - 
    Sunday task #1) (Canada Only)\",\"adjusted_amount\":8.0}

但是 json_decode 在 php 中不起作用。帮助???

4

1 回答 1

3

那不是有效的 JSON。在 JSON 键中,必须用 引用",因此您的 JSON 内容将是

{
    "payload": {
        "conversion_id": "32402345984532934511",
        "amount": 50,
        "adjusted_amount": 25,
        "job_title": "The title of the last job they completed (and 2 other jobs)"
    },
    "signature": "1221299611f823b8c30a347373b449ad"
}

另见http://json.org

于 2013-03-17T17:27:44.697 回答