Hello, i have a problem how to make to apear Top Billed Cast all with his photo, json is working but credits and variables it is the same on every character.
¿No encuentras una película o serie? Inicia sesión para crearla:
¿Quieres puntuar o añadir este elemento a una lista?
¿No eres miembro?
Contestado por Travis Bell
el 9 de noviembre de 2016 a las 11:07
Hi @seedfile
If you query the /movie/credits all you need to do is iterate over the
cast
array. Each item contains the person, character name and profile image for the movie.Here's some quick Ruby code showing you the first 4 credits from Fight Club (just as an example):
Contestado por seedfile
el 9 de noviembre de 2016 a las 11:36
I have writed this code....
and didn't working...
Contestado por Travis Bell
el 9 de noviembre de 2016 a las 11:47
Take a look at the response you're getting back, there is no key called
credits_id
in the root of the JSON object. You need to first access thecast
array, then iterate over each item like I did above .Contestado por seedfile
el 9 de noviembre de 2016 a las 12:47
echo $movcredits["cast"][0];
dind't work, have you another php solution like my?
Contestado por Travis Bell
el 9 de noviembre de 2016 a las 12:55
I don't know PHP, so I can't be very helpful with that. There's 2 things I suggest at this point:
Cheers.