I have an object and like to retrieve the value of one or more elements from the object. Hire is one of the objects if put in a var_dump().
object(SimpleXMLElement)#13 (2) {
["@attributes"]=>
array(1) {
["name"]=>
string(5) "chain"
}
["value"]=>
string(11) "Abba Hotels"
}
I get the value but i can not get to the name.
To get the value i use for example:
echo $row->property->value
My first thought was to use:
echo $row->property->@attributes->name
, but it return as a ERROR. I try to use @attributes in a variable but that gives a NULL.
At second thought i tried to use get_object_vars() and in_array() but no luck again.
Do you guys have a idea about how i can get to the value of the "name" object?