Solved

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

Posted on 2015-02-04
3
511 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

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 35

Expert Comment

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

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

623 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