Solved

MySQL - need to remove all occurrence of Adblock code from my html.

Posted on 2015-02-04
3
483 Views
Last Modified: 2015-02-04
Hi,
one of my customers has been using  Adblock Plus while editing pages in html editor which has resulted in an abp attribute bring added to every element.

<h1 abp="861">Text </h1>
<p abp="877" colspan="2">&nbsp;</p>
<p abp="873">&nbsp;</p>

Open in new window


Is there an easy way to search and remove all abp="some number" code using MySQL or PHP?

Thanks
0
Comment
Question by:sabecs
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 500 total points
ID: 40588079
Read each page from your database into a variable, delete those codes and then update the db with the content of the variable.

This will delete all occurrences of ' abp="123"' from a string:
$content = preg_replace("/ abp=\"\d+\"/", "", $content);

HTH,
Dan
0
 

Author Closing Comment

by:sabecs
ID: 40590399
Thanks Dan, that is perfect...
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 40590401
You're welcome.
Glad I could help!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now