- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I have an array that I need to get specific values from.
I’m trying to list the movie titles from every key but not sure how to go about it.
Normally I would have to do something like this:
$trakt->activity[0]->movie->title;
$trakt->activity[1]->movie->title;
$trakt->activity[2]->movie->title;
...etc
The other container is an array, so you can use array indexes as normal. The inner containers are objects.
$trakt[0]->movie->title
$trakt[1]->movie->title
$trakt[2]->movie->title
…etc
(or)
foreach( $trakt as $obj ){
$obj->movie->title;
}
Ah ha!
foreach( $trakt as $obj ){
$obj->movie->title;
}
That is exactly what I was trying to do initially with a foreach but it didn’t work out. Clearly I was doing it wrong.
Thanks, @traq
no problem : )
While I have you, can you email me so I can discuss something with you?
Email is here.