Converting html into plain text |
[eluser]Unknown[/eluser]
Is anyone there who knows a way to convert html into plain text....it could be a function or a pluggin or anything ´cause I´m supposed
[eluser]sophistry[/eluser]
you mean like PHP's htmlentities() function? it's not clear what your question is... try to be more specific about your application.
[eluser]Unknown[/eluser]
Sorry, I´m gonna try to explain myself better. In my database I have stored the text of a news but in html format, so it happens that when I show the news in the browser all the html characters are shown. So what I need is a function or something that prevents those characters to be shown, what means that I want to show the news in plain text. I hope someone understands me this time. Thanks a lot anyway.
[eluser]John_Betong[/eluser]
Hi Nakshibil, Is_this_what_you_mean In my database I store articles similiar to the above. The article includes thumbnails and links to bigger pictures. The text is mostly hard-coded HTML. All the article information is saved to a Mysql memo field. Code: $sql = "INSERT INTO blog_article (entry_id, title, memo, author, date) VALUES(" The Html formatted text is retrieved and sent to my view using the following: Code: $article_to_display = nl2br($row->memo). Cheers, John_Betong
[eluser]Phil Sturgeon[/eluser]
I second strip_tags(), works great. Instead of converting HMTL tags to text, it just rips em out. |
Welcome Guest, Not a member yet? Register Sign In |