Reply to Re: How to strip styles embedded within html tags?

Your name:

Reply:


Posted by Rik on 10/18/06 14:42

Steve wrote:
> "Kimmo Laine" <spam@outolempi.net> wrote in message
> news:tAoZg.8539$7C4.2594@reader1.news.jippii.net...
>> "Steve" <beachie41@NOSPAM.gmail.com> wrote in message
>> news:4bnZg.15962$lU6.10673@fe78.usenetserver.com...
>>> Hi,
>>> I'm a complete PHP n00b slowly finding my way around
>>> I'm using the following function that I found on php.net to
>>> strip out html and return only the text.
>>
>> You know, there is a built-in function strip_tags() that does
>> exactly that, so if your only goal is to strip tags, you might
>> just as well use that. If you're just trying to learn php and
>> regex, then you should go the hard way and write the strip
>> function by yourself. :)
>> >
> Hi,
> Yes, but strip_tags doesn't address my problem does it? I was
> using it before I came across that faction. As for learning
> regex, I agree, but right now I need to be able to do this ASAP
> :)

If you just simply want to strip ALL html tags:
preg_replace('/<[^>]*>/s','',$html);

--
Grtz,

Rik Wasmus

[Back to original 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

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