Solved

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

Posted on 2015-02-04
3
491 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Echo vs ?><?php  html code 4 46
PHP_POST() error message 9 44
WordPress syntax 2 28
using php variable inside javascript 5 15
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

867 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

15 Experts available now in Live!

Get 1:1 Help Now