Thank you very much for the script.
I just tried it in my page.

It worked ok, but in the page I have some formating such as <center>,<div> etc.. tags, and all of the text + the formatting is echoed in the output.

How can I remove the formating and just keep the plain text?