我知道这是一个基本问题,但我无法弄清楚如何实际做到这一点。我已经阅读了无数关于它的教程,但它们似乎不起作用。
var_dump($google_check);
返回以下内容:
string(488) "{
"matches": [
{
"threatType": "MALWARE",
"platformType": "LINUX",
"threat": {
"url": "http://malware.testing.google.test/testing/malware/"
},
"cacheDuration": "300s",
"threatEntryType": "URL"
},
{
"threatType": "MALWARE",
"platformType": "LINUX",
"threat": {
"url": "http://malware.testing.google.test/testing/malware/"
},
"cacheDuration": "300s",
"threatEntryType": "URL"
}
]
}
"
我想从数组中回显结果,所以像
echo $google_check[0][matches][threat];
echo $google_check[1][matches][threat];
问题是这会在匹配和威胁上返回非法偏移,并且只回显单个字符 {
我究竟做错了什么?如何在不转储整个数组的情况下回显该数组的结果?