How do you access a PHP object that has a #
in the $key name?
Example:
[image] => stdClass Object
(
[#text] => http://userserve-ak.last.fm/serve/_/85003/Red+Hot+Chili+Peppers.jpg
[name] => original
[width] => 937
[height] => 1276
)
I want to access the #text
property, but $image->#text
doesn't work because PHP interprets the #
as the start of a comment.
How do I do this?
You can try with:
$image->{'#text'}
maybe like this: (not sure)
$image->{"#text"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With