If print_r($object)
returns
stdClass Object
(
[*] => sometext
)
How do I get the property of the asterisk, i.e $object->*
?
If print_r($object)
returns
stdClass Object
(
[*] => sometext
)
How do I get the property of the asterisk, i.e $object->*
?
You can access the property like this
$object->{"*"}
You can also convert your object to an array :
$array = get_object_vars($object);
echo $array['*'];
But answers above are even better :
$object->{"*"}
© 2022 - 2024 — McMap. All rights reserved.