I have a object $images that looks like this:
stdClass Object
(
[0] => stdClass Object
(
[id] => 125
[title] => 131301
[file_name] => 131301
[file_ext] => jpg
[dir] => Adventure/
[fk_gallery_id] => 1
)
[1] => stdClass Object
(
[id] => 126
[title] => 181301
[file_name] => 181301
[file_ext] => jpg
[dir] => Adventure/
[fk_gallery_id] => 1
)
);
Now I want to get the first element in the object:
$obj = $images[0].
This gives me the error:
Fatal error: Cannot use object of type stdClass as array
Can anyone tell me why this is not working?
I've also tried $images[0]->id, but this is not working either.