我需要访问 Json 中变量元素的值,但问题是变量有一个冒号 (:),而且我每次都得到未定义的变量。
\n\n{#370 \xe2\x96\xbc\n +"im:name": {#371 \xe2\x96\xb6}\n +"im:image": array:3 [\xe2\x96\xb6]\n +"im:itemCount": {#380 \xe2\x96\xb6}\n +"im:price": {#381 \xe2\x96\xb6}\n +"im:contentType": {#385 \xe2\x96\xb6}\n +"rights": {#387 \xe2\x96\xb6}\n +"title": {#388 \xe2\x96\xb6}\n +"link": {#390 \xe2\x96\xb6}\n +"id": {#391 \xe2\x96\xb6}\n +"im:artist": {#393 \xe2\x96\xb6}\n +"category": {#396 \xe2\x96\xb6}\n +"im:releaseDate": {#397 \xe2\x96\xb6}\n}\nRun Code Online (Sandbox Code Playgroud)\n\n例如$feed->category可以,\n但是任何中间有 : 的东西就像$feed->im:category都会抛出错误。