You are here: Re: strip-tags problem « PHP SQL « IT news, forums, messages
Re: strip-tags problem

Posted by Stefan Rybacki on 01/10/06 13:34

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Danny wrote:
> Hallo, all
>
> I have used this function.
> $string = strip_tags($p1,'<i><b><u><br><p><font>');
>
> The problem is that the title will be printed as well, but i dont allow the
> title tag.
>
> The intention is that people works from Word .doc domuments and saves the
> files as html. then the html file can be inserted in the database.
>
> How to i exclude the <title> tag ?
>

Do you mean you want to remove the title tag as well as the text between the
ending title tag?
So you want "<title>title</title>" to be "" instead of "title"?

Use a regular expression:

preg_replace("/<title>[^<]*</title>/","",$text);

but note if somewhere in the text is another <title>title</title> it will be
removed as well.

Regards
Stefan

> Thanks
>
> Danny
>
>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1rc2 (MingW32)

iD8DBQFDw5vbyeCLzp/JKjARAo2hAJ9l8JQ48YdUepfJ+luelk1xN+DYyACfc1kd
xdii1mYF0zVRI1pvdYeV49g=
=947o
-----END PGP SIGNATURE-----

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация