function discogs($artist,$album){ $artist = utf8_encode(str_replace(' ','%20',$artist)); $data = @file('http://www.discogs.com/artist/'.$artist); if (empty($data)) die("Artist Not Found"); foreach ($data as $line_num => $line){ if (preg_match("/".$album."/i", $line)){ preg_match('/ $line){ if (preg_match('/http:\/\/www.discogs.com\/image/i', $line)){ preg_match('/\n"; $url = "http://www.discogs.com/image/".$matches[1]; return $url; } } } } }else {die("No Such Album Found for Artist ". $artist);} } }