How can i reach elements of this object with php? I have tried $obj[0]->trends
to reach inner array but php gives me error Fatal error: Cannot use object of type stdClass as array in /.....file.php on line 97
stdClass Object
(
[0] => stdClass Object
(
[trends] => Array
(
[0] => stdClass Object
(
[name] => IWorkAsHardAs
[query] => IWorkAsHardAs
[events] =>
)
[1] => stdClass Object
(
[name] => ProtectOzoneLayer
[query] => ProtectOzoneLayer
[events] =>
)
)
[as_of] => 2013-09-16T13:06:47Z
[created_at] => 2013-09-16T12:44:57Z
[locations] => Array
(
[0] => stdClass Object
(
[name] => Jaipur
[woeid] => 2295401
)
)
)
[httpstatus] => 200
)