I have a variable $entry which is set to:
stdClass Object (
[im:name] => stdClass Object
(
[label] => Amazing Breaker
)
etc.
How can I access the value “Amazing Breaker”?
I tried to define a constant:
define("IMNAME", 'im:name');
but using:
foreach ($json_output->feed->entry as $entry) {
if (isset($entry->IMNAME->label))
returns FALSE.
Problem seems to be the colon. For a key without colon the code would return TRUE.
You can use the free-form syntax with curly braces for ‘special’ property names: