You wouldn't want to use <!--*--> in the middle of the
src attribute because that would leave you with invalid HTML. Instead, it's best to just empty the
src.
PHP Code:
$pattern = '/src="[^>]+ads[^>]+."/i';
$contents = preg_replace($pattern, 'src=""', $contents);
Just remember, there are a lot more to ads than just that...
and many words that have
ads in them that are found in the
src. The biggest one is
downloads.