Reputation: 335
I've been reorganising my code to be able to better support old IE browsers. I've put everything that is HTML5 only scripts in IF statements and it all works fine.
I just have one last change I need to make. I've collected all my site into an using ob_start()
... and would like to know the easiest way to replace all html5 elements like article
with div
. I was going to use simplehtmldom
but I don't have mb_character_encoding
so it doesn't work. To make it easier I've removed all comments and put all the code on one line in the hope of using a very shiny REGULAR EXPRESSION.
Upvotes: 0
Views: 407
Reputation: 71918
Some options:
DOMDocument
(not the easiest approach)Upvotes: 2
Reputation: 13756
You can replace your <article
with <div
and </article>
with </div>
simple as that no need for complex regular expression
Upvotes: 1