|
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]
|