wordpress get image post but exclude some based on preg_match() check

Hello I am new to php but understand sometimes
I am trying to exclude some images from this function that I found by running a preg_match but it seems to never work was hoping someone here could help me out. If you need more explanation just ask. Well here is the code.
[php]function catch_that_image() {
global $post, $posts;
$first_img = ‘’;
$new_img_tag = “”;

ob_start();
ob_end_clean();
$output = preg_match_all(’/<img.+src=’"[’"].*>/i’, $post->post_content, $matches);

$first_img = $matches [1] [0];
$check_img = preg_match(’(pheedo|feedburner)’,$first_img);

if ($check_img == false) {
$new_img_tag = “”;
}
else {
$new_img_tag = “”;
}
if(empty($first_img)){ //Defines a default image with 0 width
$new_img_tag = “”;
}

else{
$new_img_tag = “”;

}

return $new_img_tag;
}[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service