<?

  $host = array("http://www.cnn.com", "http://joins.com");

  for($i=0;$i<count($host);$i++){
    $lines = file($host[$i]);
    $blob  = join(' ',$lines);
    $blob_new = strip_tags($blob,"<img>");
    $newArr = spliti("<img",$blob_new);
    for($k=0;$k<count($newArr);$k++){
       $endOfString = stristr($newArr[$k],"src=");
       if(eregi("jpg",$newArr[$k])){
       $p1 = strpos($endOfString,"\"")+1;
       if($p1===false){ // not found
                continue;
       }
       $p2 = strpos($endOfString,"\"",$p1);
           if(eregi("http://",$endOfString)){
               $url = substr($endOfString,$p1,$p2-$p1);
           }else{
        // this can be tricky
           $url = $host[$i]."/".substr($endOfString,$p1,$p2-$p1);
           }
           print("<img src=\"$url\"><br>\n");
       }else{
        // ignore gif?
       }
    }
  }

?>