Re: strip_tags and nl2br

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux