json - Pulling apart stdclass with PHP -
i'm trying access part of stdclass has property #text. php uses '#' comments i'm having trouble getting php parse not comment. example of stdclass below
stdclass object ( [artist] => stdclass object ( [name] => john denver [mbid] => 34e10b51-b5c6-4bc1-b70e-f05f141eda1e [url] => http://www.last.fm/music/john+denver [image] => array ( [0] => stdclass object ( [#text] => http://userserve-ak.last.fm/serve/34/521025.jpg [size] => small
and i've tried access with:
$json->artist->image[0]->#text but how can escape '#' or tell php interpret differently. or there format find #text property.
i tried:
$json['artist']['image'][0]['#text'] but error. i'm sure simple it's got me @ moment.
you can access such properties following code:
$object->{'#text'}
Comments
Post a Comment