Re: strip_tags and nl2br
| From: | Chris | Date: | Wed, 21 May 2008 06:18:22 +0000 |
| Subject: | Re: strip_tags and nl2br | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274589@lists.php.net to get a copy of this message | ||
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/