this is my json object
object(stdClass)#23 (2) { ["type"]=> string(4) "text" ["$t"]=> string(10) "cippalippa" }
How can I access to "text" ["$t"] ?
You need to use this syntax:
$object->{'$t'}
The other two that were mentioned here don’t work as:
– an object is not an array$object["\$t"]
– this would be interpreted as a variable variable:$objetct->$t
[…] if you have an expression such as
$foo->$bar, then the local scope will be examined for$barand its value will be used as the name of the property of$foo.
'text'or[$t]