Converting HTML to plain text in PHP for e-mail

Posted by jstayton on Stack Overflow See other posts from Stack Overflow or by jstayton
Published on 2009-12-10T22:31:54Z Indexed on 2010/04/02 0:43 UTC
Read the original article Hit count: 411

Filed under:
|
|
|

I use TinyMCE to allow minimal formatting of text within my site. From the HTML that's produced, I'd like to convert it to plain text for e-mail. I've been using a class called html2text, but it's really lacking in UTF-8 support, among other things. I do, however, like that it maps certain HTML tags to plain text formatting — like putting underscores around text that previously had <i> tags in the HTML.

Does anyone use a similar approach to converting HTML to plain text in PHP? And if so: Do you recommend any third-party classes that I can use? Or how do you best tackle this issue?

Thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about html