How is it possible to save client entered text in the same format in PHP? -
i save text database can entered client php , mysql. lets have textarea , want save exact layout, how client entered text.
by exact layout mean:
- exact spaces
- exact linebreaks
after want display them in same format. of course html js tags wiped out when we're outputting text.
it's practice store original text in database render filtered text.
you can change linebreaks html nl2br()
, use htmlentities()
function prevent xss vulnerability.
Comments
Post a Comment