php中的json_decode返回空值

vq8itlhq  于 2022-10-30  发布在  PHP
关注(0)|答案(1)|浏览(166)

我知道这是一个重复的问题,但我几乎尝试了所有答案中给出的所有解决方案,我没有得到它的工作
下面是我的编码JSON响应

string(22672) "{"status":true,"result":{"0":{"keyword":"BMW","avg_cpc":0.405132,"min_clicks":42847.5859375,"avg_budget":17358.92818603125},"1":{"keyword":"BMW livrable","avg_cpc":0,"min_clicks":0,"avg_budget":0},"2":{"keyword":"BMW disponible","avg_cpc":0.595299,"min_clicks":27.446643829345703,"avg_budget":16.338959624965668},"3":{"keyword":"bonne affaires BMW","avg_cpc":0,"min_clicks":0,"avg_budget":0},"4":{"keyword":"BMW en stock","avg_cpc":0.370574,"min_clicks":12.511731147766113,"avg_budget":4.63652225835228},"max_cpc":1.0131090475410072,"min_clicks":42887.54431247711}} "

对于上面的json json_last_error_msg(),返回Syntax error
尝试了此答案中给出的所有内容:json_decode returns JSON_ERROR_SYNTAX but online formatter says the JSON is OK和其他的也是。没有对我工作。
我已经参考了所有的答案,并尝试了一切,但我不能解码的JSON。坐了几个小时,并决定提出问题,在堆栈溢出请给予我一个解决方案。
直接回应:

{"status":true,"result":{"0":{"keyword":"BMW","avg_cpc":0.407065,"min_clicks":42202.34765625,"avg_budget":17179.098648691408},"1":{"keyword":"BMW livrable","avg_cpc":0,"min_clicks":0,"avg_budget":0},"2":{"keyword":"BMW disponible","avg_cpc":0.598459,"min_clicks":27.12619400024414,"avg_budget":16.233914935192107},"3":{"keyword":"bonne affaires BMW","avg_cpc":0,"min_clicks":0,"avg_budget":0},"4":{"keyword":"BMW en stock","avg_cpc":0.367595,"min_clicks":11.617576599121094,"avg_budget":4.270563069953918},"max_cpc":1.0179426327372374,"min_clicks":42241.091426849365}}
iswrvxsc

iswrvxsc1#

在Postman中检查时发现了这个问题。从api响应中显示string(22672)的原因是我在浏览器中看不到一些Html代码沿着JSON响应。
我修复了API端的问题

相关问题