You are here: Re: strip Tags problem « PHP Programming Language « IT news, forums, messages
Re: strip Tags problem

Posted by Pedro Graca on 01/10/06 15:17

Danny top-posted (reformatted) and failed to attribute (corrected):
> Pedro Graca wrote:
>> Danny wrote:
>>> 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.
>>>
>>> How to i exclude this ?
>>
>> remove the title and its contents before applying strip_tags.
>>
> Yes i know i can do that, but the problem is, that the customer cant. The
> customer works from a word file and saves it as an html file. Word always
> puts the title in it. Why the strip tag allows title standard?

strip_tags removes the <title> tag, just like it removes the <b> or <a>
tags. What it doesn't do is remove the text between the tags.

<?php
echo strip_tags('outer <title>inner <a href="x">link</a> content</title> content');
?>

will output "outer inner link content content"
______^^^^________

Maybe you can try to replace <title> with "<!-- " and </title> with " -->"
if you don't want to check everything like I did on my last post.

--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!

 

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

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