php_lover Posted July 13, 2013 Share Posted July 13, 2013 Ok , there is an issue with the rotten tomatoes API , It gives developers the ability to set a limit of movies to return from the API from a specific category , like the movies in the box office are pulled dynamically, but when I set the limit to 50 , or even 10 movies , it only returns an array containing 3 movies instead of 10 or 50 or whatever the limit of movies is in the API call ... What could be causing that ? is there maybe something wrong with the way I am using the file_get_contents function $box_office_movies = file_get_contents('http://api.rottentomatoes.com/api/public/v1.0/lists/movies/box_office.json?limit=50&country=us&apikey=[key]',FILE_USE_INCLUDE_PATH); $box_office_movies = json_decode($box_office_movies, true); var_dump($box_office_movies); // returns only 3 movies .. Link to comment https://forums.phpfreaks.com/topic/280121-is-there-something-wrong-with-my-call-to-the-rotten-tomatoes-api-its-returning-only-3-movies-instead-of-the-number-requested/ Share on other sites More sharing options...
denno020 Posted July 13, 2013 Share Posted July 13, 2013 Try var dumping "$box_office_movies['movies']". You'll see that you do actually get all the movies back.. Link to comment https://forums.phpfreaks.com/topic/280121-is-there-something-wrong-with-my-call-to-the-rotten-tomatoes-api-its-returning-only-3-movies-instead-of-the-number-requested/#findComment-1440597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.