Re: [PHP] strip_tags and nl2br



James Colannino wrote:
Hey everyone,

I have a little bit of a quandry. I need to strip HTML tags from user
input, but I also need to convert \n's from the textarea elements to
<br> tags so it will display properly in a browser.

RTM.

Supply the tags you want to keep when you call strip_tags.

$stripped = strip_tags($data, '<br/><br>');

--
Postgresql & php tutorials
http://www.designmagick.com/
.