Help with reg ex /preg_replace
I want to remove completly with preg_replace
<a href="http://feedads.g.doubleclick.net/~a/DoZCMoSsD67yAdsBepwwwwfo5M/0/da">
<img border="0" ismap="true" src="http://feedads.g.doubleclick.net/~a/DoZC.jpg"/>
</a><a href="http://feedads.pheedo.net/~a/DoZCMow">
<img border="0" ismap="true" src="http://feedads.pheedo.net/~a/DoZqwq"/>
</a>
but I want to keep all other links and images.
In other words, I want to remove ads and feedburner's feedflare from feeds.
Please help.
decibel.places posted this at 22:15 — 2nd May 2009.
He has: 1,494 posts
Joined: Jun 2008
mod teammatt has a link to a regex tester in his sig
If you do not want the feedburner branding in your feed, have you considered alternate feed methods?
and have you checked the TOS regarding removing the ads and flare?
you may also consider a DHTML solution which hides the "feedads" images and nullifies the "feedads" links (see attached):
<script type="text/javascript">
<!--
fbimgs = new Array();
fbimgs = document.getElementsByTagName('img');
if (fbimgs)
{
for (i=0; i<fbimgs.length; i++)
{
fbimgsrc=fbimgs[i].src;
if (fbimgsrc.indexOf('feedads'))
{
fbimgs[i].style.display="none";
fbimgs[i].isMap=false;
}
}
}
fbancs = new Array();
fbancs = document.getElementsByTagName('a');
if (fbancs)
{
for (j=0; j<fbancs.length; j++)
{
fbancsrc=fbancs[j].href;
if (fbancsrc.indexOf('feedads')) fbancs[j].href="javascript:void(0)";
}
}
//-->
</script>
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.