Re: [PHP] strip_tags

[email protected] (Matijn Woudt)
Newsgroups php.general
Message-ID <CAC_gtuPp54qnEetbH5ax05wKyTCbpuV7q++QPMwJgwcj3qOpgA@mail.gmail.com>
Op 21 jul. 2013 02:53 schreef "Tedd Sperling" <[email protected]> het
volgende:
>
>
> On Jul 20, 2013, at 5:34 PM, Frank Arensmeier <[email protected]>
wrote:
>
> > 20 jul 2013 kl. 18:25 skrev Tedd Sperling <[email protected]>:
> >
> >> Hi gang:
> >>
> >> I've been using
> >>
> >>   $str = strip_tags($str, $allowable)
> >>
> >> as it is described via the manuals:
> >>
> >> http://php.net/manual/en/function.strip-tags.php
> >>
> >> The problem I've found is the tags "<br>" and "<br />" are not
stripped.
> >>
> >> How do you strip all tags, but leave some tags (such as <b>, <i>, and
<u> -- I know these are depreciated, but my client wants them anyway).
> >>
> > From the manual:
> > allowable_tags
> > You can use the optional second parameter to specify tags which should
not be stripped.
> >
> > Note:
> > HTML comments and PHP tags are also stripped. This is hardcoded and can
not be changed with allowable_tags.
> >
> > Note:
> > This parameter should not contain whitespace. strip_tags() sees a tag
as a case-insensitive string between < and the first whitespace or >. It
means that strip_tags("<br/>", "<br>") returns an empty string.
> >
> > It's all there… ;-)
> >
> > Cheers,
> > /frank
> >
>
> Yeah, but that wasn't the problem -- it was my mistake in coding.
>
> In any event, I figured it out.
>
> tedd
>

Could you perhaps post what the problem was so that when someone searches
for it they will have the answer right here?

- Matijn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.