Im sure Im just doing something wrong, but whenever I try to search for anything with a space, it returns no results. "I am legend" for example returns nothing.
What I have:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://api.themoviedb.org/3/search/movie?api_key=REMOVED&query=$_GET[search]&page=$_GET[page]&include_adult=false&language=en&sort_by=popularity.desc");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Accept: application/json",
));
$response = curl_exec($ch);
curl_close($ch);
$json = json_decode($response);
$count = count($json->{'results'});
Es fehlt ein Film oder eine Serie? Logge dich ein zum Ergänzen.
Diesen Eintrag bewerten oder zu einer Liste hinzufügen?
Kein Mitglied?
Antwort von Jiinxt
am 25. Oktober 2015 um 10:58
I figured it out, needed to add "%20" into the string.