Re: [PHP] strip_tags and nl2br



Chris wrote:

RTM.

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

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

I can do that, but my question had to do with strip_tags seeming to get rid of \n's, not <br> tags. This is why I was concerned. If I run strip_tags(), followed by nl2br, the <br> tags that nl2br generates should be there.

James
--
My blog: http://www.crazydrclaw.com/
My homepage: http://james.colannino.org/

"Black holes are where God divided by zero." --Steven Wright

Attachment: signature.asc
Description: OpenPGP digital signature



Relevant Pages

  • Re: combine html pages for printing?
    ... On 2004-09-28, Dances With Crows wrote: ... > begin and end tags for the HTML document. ... > ...there may be a more efficient way of doing this, but that'll get rid ... My code in this post is copyright 2004, Chris F.A. Johnson ...
    (comp.os.linux.misc)
  • [PHP] Wrapping code inside [code]xxx[/code] tags.
    ... I have on my site a part where users' can submit articles and no doubt their ... Code is wrapped inside of tags, ... highlight_file and the rest of the code needs to be formatted with nl2br, ... strip_tags and possibly stripslashes/wordwrap. ...
    (php.general)
  • Re: combine html pages for printing?
    ... I think Chris was being facetious. ... begin and end tags for the HTML document. ... cat start.txt temp.html end.txt> final.html ... ...there may be a more efficient way of doing this, but that'll get rid ...
    (comp.os.linux.misc)
  • How to list/find html tags in text
    ... Because I want to use nl2br on the text, but since this command add br instead of all /n it is not a nice thing to add t.x. ... Of course it is possible to add the list and remove all space between li tags, but this is not so readable to the writer. ... Regards, Sindre ...
    (comp.lang.php)
  • Re: [PHP] strip_tags and nl2br
    ... Supply the tags you want to keep when you call strip_tags. ... strip_tags, followed by nl2br, the tags that nl2br generates ... $ php eg.php ... here is a bold tag ...
    (php.general)