/    Sign up×
Community /Pin to ProfileBookmark

how to get php to render html tags

so i have some text stored in a database that has html tags in it, for instance <br />. when i echo this string the <br /> appears, it generates the &gt; and &lt; for me. but i want it to render the tag and make an actual break. how do i do that?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiMay 24.2010 — Assuming the database really does contain the literal characters that make up the tags, and the tags are not being output inside some kind of <pre> or similar tag, then the HTML code should be seen and understood by the browser. It seems like something is converting the html tag characters into entities somewhere between your database and your browser, so the proper solution would be to track that down, but you can also convert back using html_entity_decode.
×

Success!

Help @adamscott421 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...