This is a PHP question...
Should've mentioned it on the original title

On Oct 21, 12:02 pm, Kromitvs <[EMAIL PROTECTED]> wrote:
> Hy,
> I came across an error on my application. Here is a snippet of code.
> You will notice I list in the begging several expressions witch also
> produce the same error, and others (similar to my eyes) which don't.
> I've been using the general Search, and the Blog search. The error
> seems to apear only on the Blog search!
>
> I'm at a lost here!
> Can someone help? Reproduced it? Tell me what I'm doing wrong? Fix it?
> (congratulate me on finding my first BUG?)
>
> Thanks!!!!!!!!!
>
> CODE:
>
> <?php
>
> /*
> Error
> $teste[0] = 'aos%2Cma';
> $teste[2] = '1os%2Cma';
> $teste[5] = 'aos%2C3a';
> $teste[6] = 'aos%2Ca3';
> $teste[3] = 'aos%2Cmm';
> $teste[4] = 'aos%2Caa';
> $teste[6] = 'dfg%2Cma';
> $teste[7] = 'sfd%2Cma';
> $teste[8] = 'asd%2Cma';
> $teste[6] = 'dfg%20ma';
> $teste[8] = 'asd%21ma';
>
> No error
> $teste[1] = 'aos%2Cm';
> $teste[2] = 'aos%2C';
> $teste[3] = 'aos';
> $teste[4] = 'ao';
> $teste[5] = 'a';
> $teste[6] = '123%2C23';
> $teste[7] = 'qwe%2Cqw';
> $teste[8] = 'ads%2Cfd';
> $teste[9] = 'a%20s%2C%20a';
> $teste[10] = 'a%22%22%2Cm%20';
> $teste[11] = '%20os%2C%20a';
> $teste[12] = 'a%20%20%2C%20a';
> $teste[13] = 'a-s%2C--';
> $teste[14] = 'aaa%2Caa';
> $teste[15] = '222%2C22';
> $teste[1] = 'ooo%2Cma';
> $teste[2] = 'sss%2Cma';
> */
>
> $teste[0] = 'aos%2Caa';
> $teste[6] = 'dfg%20ma';
> $teste[7] = 'sfd%22ma';
> $teste[11] = 'asd%2Dma';
>
> foreach ($teste as $temp)
> {
> $QueryUrlBlogSearch = 'http://ajax.googleapis.com/ajax/services/search/
> blogs?v=1.0&q=' . $temp;
> print '<strong><br / ><br /> ' . $temp . '</strong>  : ';
>
> //===Google Blog Search AJAX API
> $ch2 = curl_init();
> curl_setopt($ch2, CURLOPT_URL, $QueryUrlBlogSearch);
> curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch2, CURLOPT_REFERER, '');
> $SearchResult2 = curl_exec($ch2);
> curl_close($ch2);
> $jsonBlog = json_decode($SearchResult2);
> // now have some fun with the results... (ye... right!)
>
> if ($jsonBlog->{'responseStatus'} != 200)
>
> {
> var_dump ($jsonBlog);
> print '<br />$jsonBlog->{responseStatus} : ' . $jsonBlog-
>
> >{'responseStatus'};
> //die;
> }
>
> elseif (!count($jsonBlog->{'responseData'}->{'results'})) print '<div
> style="color:blue">No result!! :-)</div>'  ;
>
> else
> {
>  foreach ($jsonBlog->{'responseData'}->{'results'} as &$cc2)
>         print   '<div style="color:green"> content ' . $cc2->{'content'} .
> '</div>';
>
> }
> }//end outer foreach
>
> ?>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-AJAX-Search-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to