Re: [PHP] strip_tags and nl2br
- From: dmagick@xxxxxxxxx (Chris)
- Date: Wed, 21 May 2008 16:18:22 +1000
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/
.
- Follow-Ups:
- Re: [PHP] strip_tags and nl2br
- From: James Colannino
- Re: [PHP] strip_tags and nl2br
- References:
- strip_tags and nl2br
- From: James Colannino
- strip_tags and nl2br
- Prev by Date: strip_tags and nl2br
- Next by Date: Re: RES: [PHP] Help Call Javascript Methods Inside PHP
- Previous by thread: strip_tags and nl2br
- Next by thread: Re: [PHP] strip_tags and nl2br
- Index(es):