Re: [PHP] strip_tags and nl2br

2008-05-21 Thread James Colannino
James Colannino wrote: Chris wrote: Are you sure there are newlines before you run strip_tags? I would assume so, because everything from the textarea runs together in one line when displayed in the browser until filtered through nl2br(). That would suggest to me that there are indeed \n's

Re: [PHP] strip_tags and nl2br

2008-05-21 Thread James Colannino
Chris wrote: Are you sure there are newlines before you run strip_tags? I would assume so, because everything from the textarea runs together in one line when displayed in the browser until filtered through nl2br(). That would suggest to me that there are indeed \n's that are being converte

Re: [PHP] strip_tags and nl2br

2008-05-21 Thread Chris
James Colannino wrote: > Chris wrote: > >> RTM. >> >> Supply the tags you want to keep when you call strip_tags. >> >> $stripped = strip_tags($data, ''); > > I can do that, but my question had to do with strip_tags seeming to get > rid of \n's, not tags. This is why I was concerned. If I run >

Re: [PHP] strip_tags and nl2br

2008-05-21 Thread James Colannino
Chris wrote: RTM. Supply the tags you want to keep when you call strip_tags. $stripped = strip_tags($data, ''); I can do that, but my question had to do with strip_tags seeming to get rid of \n's, not tags. This is why I was concerned. If I run strip_tags(), followed by nl2br, the tags

Re: [PHP] strip_tags and nl2br

2008-05-20 Thread Chris
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 > tags so it will display properly in a browser. RTM. Supply the tags you want to keep when you call strip_tag

[PHP] strip_tags and nl2br

2008-05-20 Thread James Colannino
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 tags so it will display properly in a browser. nl2br() works just fine, but if I use strip_tags first, then run nl2br, nl2br won't work a