Author Archive

why there are some silent people?

If a person is silent it does not mean he is unknown of fun, enjoyment… But it means life has taught him some lessons which has made him SILENT…

Great lines, great persons

  • If you born poor, its not your mistake but if you die poor its your mistake.
  • Born with personality is an accident but dying in a personality is an achievement.
  • You birth may be normal but you death should be history.
  • Like all, trust few.
  • Follow none but learn from everyone.
  • Practice like a devil and play like an angel.
  • Do or DIE is an old concept, DO IT BEFORE DEATH is a new concept.
  • The following php function will return an array(0-10) of image URLs.

    
    <?php
    /* Returns 10 image URLs array */
    function images_search($se, $kw){
     $icount=0;
     $image =array();
     if($se=="Bing"){
     $imgs = 'http://www.bing.com/images/search?q='.urlencode(trim($kw));
     $imgs = file_get_contents($imgs);
     preg_match_all("/<span class=\"md_mu\">(.*?)<\/span>/is", $imgs, $imgu, PREG_PATTERN_ORDER);
    
     shuffle($imgu[1]);
     $iv = array_values($imgu[1]);
    
     for($j=0; $j < count($iv);$j++)
     if(strpos($iv[$j],'"')>-1 || strpos($iv[$j],'""')>-1) continue;
     elseif(@fclose(@fopen($iv[$j], "r"))){  
     $image[$icount]=$iv[$j];
     $icount++;
     if($icount==10)
     break;
     }
     }else{
     $start=rand(0,9)*20+1;
     $imgs= 'http://images.google.com/images?gbv=2&hl=en&q='.urlencode(trim($kw)).'&sa=N&start='.$start.'&ndsp=30';
     $imgs = file_get_contents($imgs);
     preg_match_all("/x3dhttp:(.*?).jpg/is", $imgs, $imgu, PREG_PATTERN_ORDER);
    
     shuffle($imgu[1]);
     $iv = array_values($imgu[1]);
    
     for($j=0;$j<count($iv);$j++)
     if(strpos($iv[$j],'"')>-1 || strpos($iv[$j],'""')>-1) continue;
     elseif(@fclose(@fopen('http:'.$iv[$j].'.jpg', "r"))){  
     $image[$icount]='http:'.$iv[$j].'.jpg';
     $icount++;
     if($icount==10)
     break;     
     }
     }
     return $image;
    }
    ?>
    

    Use this function like this:

    <?php
    
    // Call function like
    
    $google_images = images_search('Bing', 'doctors');
    
    // or
    
    $bing_images = images_search('Google', 'forex');
    
    ?>