Method sharing of php regular deletion of class style attributes in html code
This article mainly explains the "php regular deletion of class style attributes in html code method sharing", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "php regular deletion of class style attributes in html code method sharing" bar!
1. Question:
The code is as follows:
Welcome to visit
Requirement: remove the class attribute from the HTML code.
Second, the realization method:
The php implementation code is as follows:
Welcome to $str=''; $str=preg_replace ('/ class= "([^\"] *) "/ isU','',$str); echo $str
Running result:
Welcome to visit and thank you for reading, the above is the content of "php regular deletion of class style attributes in html code to share". After the study of this article, I believe you have a deeper understanding of the method of php regular deletion of html style attributes in html code to share this problem, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!