/ Published in: PHP
This function takes HTML input and converts it to plain text. It needs improvement so that it converts multiple blank lines to a single blank line and converts an <a ... > link to the markup equivalent (same for images). It should be rewritten to using a DOM/XML parser.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function html_to_plain($html) { //$plain_message = str_replace(" ", ' ', $plain_message); return $plain_message ; }