阅读卷曲PHP结果
我正在做一个卷曲,并获得JSON结果:
$data = json_decode($result, true);
var_dump($data);
$data = $data["data"];
echo $data;
但是,$ data的回声为“ {”。如果我在再次分配变量之前进行var_dump,我会看到:
string(727796) "{"data":["base64_image1", "base64_image2",... ]}"
为什么我无法访问数据列表?我只想在此列表上做一个foreach,但我不能。
I'm doing a curl and getting the JSON result as:
$data = json_decode($result, true);
var_dump($data);
$data = $data["data"];
echo $data;
However, the echo of $data is "{". If I do a var_dump before assigning again the variable I see:
string(727796) "{"data":["base64_image1", "base64_image2",... ]}"
Why am I not able to access the data list? I just want to do a foreach over this list, but I cannot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
输出是JSON,所以尝试再次尝试json_decode()
output is json so try to json_decode() again