私は次のようなオブジェクトを持っています$images
:
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
)
);
次に、オブジェクトの最初の要素を取得します。
$ obj = $images[0]。
これは私にエラーを与えます:
Fatal error: Cannot use object of type stdClass as array
なぜこれが機能しないのか誰か教えてもらえますか?
私も試しまし$images[0]->id
たが、これも機能していません。