PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am displaying a query result with is a TEXT column in a database. It's contents are filled with simply html tags like "<b>". When echoing this record, how can I get it to show as HTML and not the actual tags? Here is the code so far:
AliasBDI wrote:It showed the tags as actual HTML: "blah blah <b>blah..." It did not convert it to bold text. This seems to the backwards than what I want.
Hmmmm.. I would have expected the "<" to be translated to "<". It would display in the browser as "<", but the view source would show <
Do you actually want <B> to make the text bold? If that's all you're shooting for, then just dump the stuff to the browser.
Let me ask it this way: If the database record contains "I'm <i>so</i> glad you <b>boldly</b> took that step", what exactly do you want the browser to display?
Then I think you just want to dump it straight from the database onto the browser. Don't run it through any functions at all. Then I believe you'll have what you want.
You're right... My mistake - making things complicated. But what about converting line endings? So when a person puts a return at the end of a sentence instead of a <br> tag, I want it to display as a return.
AliasBDI wrote:You're right... My mistake - making things complicated. But what about converting line endings? So when a person puts a return at the end of a sentence instead of a <br> tag, I want it to display as a return.