Searching Doubt

For developers and developing site - suggestions, coding problems, API questions, new applications...
Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.

Searching Doubt

Postby LusoTycoon » Fri Aug 17, 2012 9:32 pm

I'm trying to build a search script through the API but i have a little doubt

I have this

Code: Select all
$client = new IXR_Client('http://api.opensubtitles.org/xml-rpc');
//$client->debug = true;
if ($client->query("SearchSubtitles",  $myFile1  , array(array('query'=>$lines[1], 'sublanguageid'=>'por')) )) {
   $response = $client->getResponse(); print_r($response) ;


Which outputs all the subtitles matching the query
(i'm trying to search for a specific one, The.Hunger.Games.RERIP.720p.BluRay.X264-BLOW, but the server returns me all The Hunger Games subtitles for that language, i think)

So after that i try this, for instance:

Code: Select all
for ($i=0; $response[$i]["UserID"] != 0; $i++) { echo $response[b]["data"][/b][$i]["SubFileName"]; }

(line 29)


Result:
Notice: Undefined offset: 0 in C:\Users\User\Desktop\xampp\htdocs\index2.php on line 29


Any ideas?
For now solved adding the "data" as a 'dimension of the array'
LusoTycoon
 
Posts: 1
Joined: Fri Aug 17, 2012 8:19 pm

Re: Searching Doubt

Postby oss » Thu Sep 27, 2012 6:36 pm

so I guess everything is ok, you reply to your question.
User avatar
oss
Site Admin
 
Posts: 2208
Joined: Sat Feb 25, 2006 11:26 pm


Return to Developing

Who is online

Users browsing this forum: No registered users and 0 guests