I have a small issue with the Json output from an API (it’s the last.fm API, if that’s relevant): a field name in the results includes a #
sign and I’m not sure how to handle this.
For example, if $response->artist
looks like this:
stdClass Object
(
[mbid] => f271fb3e-a850-484a-8854-d335da7a713c
[#text] => Ekin Fil
)
accessing the first part with $response->artist->mbid
is no problem at all, but trying to access the artist name with $response->artist->#text
throws an error because of the #
sign.
Is there any way to handle this?