I have a json object that follows the following structure:
$foo->bar['1']->#foobar
The hash is causing it to fail, how do I ge开发者_如何学Pythont the value of #foobar?
Thanks
Try the curly brace syntax:
$foo->bar['1']->{'#foobar'}
When you use PHP's json_decode
, pass true
as the second variable, that will return an associative array, those are easier to deal with in such cases.
精彩评论