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.
لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها
هل تريد تقييم او اضافة هذا العنصر للقائمة؟
لست عضو؟
رد بواسطة Travis Bell
بتاريخ نوفمبر 9, 2016 في 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):
رد بواسطة seedfile
بتاريخ نوفمبر 9, 2016 في 11:36 صباحا
I have writed this code....
and didn't working...
رد بواسطة Travis Bell
بتاريخ نوفمبر 9, 2016 في 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 .رد بواسطة seedfile
بتاريخ نوفمبر 9, 2016 في 12:47 مساءا
echo $movcredits["cast"][0];
dind't work, have you another php solution like my?
رد بواسطة Travis Bell
بتاريخ نوفمبر 9, 2016 في 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.