PHP中的有效JSON结果json_decode抛出语法错误

时间:2018-06-17 17:07:26

标签: php json

Welp,我看到了很多点击,但似乎没有人回答我的问题。

我有一个返回此JSON的REST方法:

这是$ result变量中的确切字符串,如下所示:

{"people":{"people":{"new_user":{"id":7,"name":"Marvin","lang":"en","read_token":1,"write_token":11,"last_access":"2018-06-17 17:00:02","writeable":true,"surname":"Martian","middle_name":"D","given_name":"Marvin","nickname":"Angry Little Fella","payload":"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIyLjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIKCSBpZD0ic3ZnMjczMzMiIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTU2LjggMjE5LjMiCgkgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTU2LjggMjE5LjM7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojRkZFODZFO30KCS5zdDF7ZmlsbDpub25lO3N0cm9rZTojMjMxRjIwO3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Tk3LjdjMC42LDAsMS4yLTEuMSwxLjMtMi41YzAuMS0xLjQtMC40LTIuNi0xLTIuNmMtMC42LDAtMS4yLDEuMS0xLjMsMi41CgkJCUMtNTc5LjgsNTk2LjUtNTc5LjMsNTk3LjYtNTc4LjcsNTk3Ljd6Ii8+Cgk8L2c+CjwvZz4KPC9zdmc+Cg==","payload_type":"image\/svg+xml;base64","associated_login":{"id":11,"name":"Marvin","lang":"en","login_id":"Marvin","write_token":11,"last_access":"2018-06-17 17:00:02","writeable":true,"user_object_id":7,"security_tokens":[11],"password":"6f2T8rK4"}}}}}

是的,它很大而且很难看,但它完全有效。

当我将它提供给JSONLint时,我得到一个漂亮的绿色条和格式良好的JSON:

{
  "people": {
      "people": {
          "new_user": {
              "id": 7,
              "name": "Marvin",
              "lang": "en",
              "read_token": 1,
              "write_token": 11,
              "last_access": "2018-06-17 16:56:49",
              "writeable": true,
              "surname": "Martian",
              "middle_name": "D",
              "given_name": "Marvin",
              "nickname": "Angry Little Fella",
              "payload": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIyLjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIKCSBpZD0ic3ZnMjczMzMiIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1s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cwLjQsNTk3LjZ6Ii8+CgkJPHBhdGggaWQ9InBhdGgxMDM2OCIgY2xhc3M9InN0NCIgZD0iTS01NzguNyw1OTcuN2MwLjYsMCwxLjItMS4xLDEuMy0yLjVjMC4xLTEuNC0wLjQtMi42LTEtMi42Yy0wLjYsMC0xLjIsMS4xLTEuMywyLjUKCQkJQy01NzkuOCw1OTYuNS01NzkuMyw1OTcuNi01NzguNyw1OTcuNyIvPgoJCTxwYXRoIGlkPSJwYXRoMTAzNzIiIGNsYXNzPSJzdDEiIGQ9Ik0tNTc4LjcsNTk3LjdjMC42LDAsMS4yLTEuMSwxLjMtMi41YzAuMS0xLjQtMC40LTIuNi0xLTIuNmMtMC42LDAtMS4yLDEuMS0xLjMsMi41CgkJCUMtNTc5LjgsNTk2LjUtNTc5LjMsNTk3LjYtNTc4LjcsNTk3Ljd6Ii8+Cgk8L2c+CjwvZz4KPC9zdmc+Cg==",
              "payload_type": "image\/svg+xml;base64",
              "associated_login": {
                  "id": 11,
                  "name": "Marvin",
                  "lang": "en",
                  "login_id": "Marvin",
                  "write_token": 11,
                  "last_access": "2018-06-17 16:56:49",
                  "writeable": true,
                  "user_object_id": 7,
                  "security_tokens": [11],
                  "password": "TuqWG+%y"
              }
          }
      }
  }
}

尽管如此,将此JSON提供给PHP 7.2.1' json_decode()函数仍然会返回JSON_ERROR_SYNTAX错误(语法错误)。

我认为问题可能在于SVG文件中的数据,但这是有效的Base64数据。在JSON中应该没问题。

我尝试了其他帖子中提到的所有各种解决方案,但仍然没有骰子。

有什么想法吗?

更新:以下是我运行的PHP代码:

echo('RESULT:<pre>');
var_dump(json_decode($result));
switch (json_last_error()) {
    case JSON_ERROR_NONE:
        echo ' - No errors';
    break;
    case JSON_ERROR_DEPTH:
        echo ' - Maximum stack depth exceeded';
    break;
    case JSON_ERROR_STATE_MISMATCH:
        echo ' - Underflow or the modes mismatch';
    break;
    case JSON_ERROR_CTRL_CHAR:
        echo ' - Unexpected control character found';
    break;
    case JSON_ERROR_SYNTAX:
        echo ' - Syntax error, malformed JSON';
    break;
    case JSON_ERROR_UTF8:
        echo ' - Malformed UTF-8 characters, possibly incorrectly encoded';
    break;
    default:
        echo ' - Unknown error';
    break;
}
echo('</pre>');

在我的服务器/笔记本电脑中,该代码正在暴露它。

更新2:这是我的cURL例程中的转储,显示响应:

string(10159) "HTTP/1.1 200 OK
Date: Sun, 17 Jun 2018 17:29:35 GMT
Server: Apache
X-Powered-By: PHP/7.2.1
Content-Length: 10007
Content-Type: application/json

{"people":{"people":{"new_user":{"id":7,"name":"Marvin","lang":"en","read_token":1,"write_token":11,"last_access":"2018-06-17 17:29:35","writeable":true,"surname":"Martian","middle_name":"D","given_name":"Marvin","nickname":"Angry Little Fella","payload":"<REMOVED FOR BREVITY>","payload_type":"image\/svg+xml;base64","associated_login":{"id":11,"name":"Marvin","lang":"en","login_id":"Marvin","write_token":11,"last_access":"2018-06-17 17:29:35","writeable":true,"user_object_id":7,"security_tokens":[11],"password":"1Jq6$oT0"}}}}}"

1 个答案:

答案 0 :(得分:0)

行。我想让你们都知道发生了什么。这不是一个答案,但它将是我绿化的那个。

我从轨道上起飞并对其进行了修复,现在它起作用了。

我必须假设我做了一些发送隐形字符的东西,这些字符没有复制和粘贴,所以JSONLint从未见过它们。我敢打赌,如果我从测试安全带直接或者直接击打,它就会被塞住。

这是对我的一个警告:不要对CLI过于激动。我可能不像我想的那样热衷于这些东西。

感谢大家的帮助。