php regexp: remove all atributes from an html tag

Posted by andufo on Stack Overflow See other posts from Stack Overflow or by andufo
Published on 2010-06-11T20:43:01Z Indexed on 2010/06/11 21:12 UTC
Read the original article Hit count: 198

Filed under:

i have this html code:

<p style="padding:0px;">
<strong style="padding:0;margin:0;">hello</strong>
</p>

but it should become (for all possible html tags):

<p>
<strong>hello</strong>
</p>

this is driving me crazy, is there a regexp expert that can give me a hand? thanks!

© Stack Overflow or respective owner

Related posts about php