Change url encoding of objects to html characters?

I used the jquery function serialize()for the form, made an ajax call, and used php to process the form.

I have textarea in the form where the user type uses spaces and line breaks. I can access the values ​​using $ _POST, but it does not interpret line breaks in html tags <br/ >. Is there a function that converts the string, translates the urlencoded string into tags <br/>and other html tags? Or is everything already decoded by the time I access it using $ _POST, that I can’t do anything about it?

+3
source share
4 answers

Use nl2br($text);(new line for interrupt rule)

+3

, nl2br(), textarea?

edit: : P

+1

PHP <br> : nl2br()

, , .

addslashes(), - ' "

+1

, html , , CSS white-space , , pre - . w3schools.

0
source

All Articles