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

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -