You are here: Re: [PHP] Re: stripping html tags « PHP « IT news, forums, messages
Re: [PHP] Re: stripping html tags

Posted by Dotan Cohen on 06/05/05 23:05

On 6/5/05, Matthew Weier O'Phinney <matthew@garden.org> wrote:
> * Dotan Cohen <dotancohen@gmail.com>:
> > I took this example from php.net, but can't figure out where I went
> > wrong. Why does this:
> > $text = preg_replace("/<head(.|\s)*?>(.|\s)*?<\/head>/i" , "" , $text);
> >
> > throw this error:
> > syntax error at line 265, column 39:
> > $text = preg_replace("/<head(.|\s)*?>(.|\s)*?<\/head>/i" , "" , $text);
> > ======================================^
> >
> > It seems to be pointing to the 'e' is 'head'. Why? Thanks.
>
> Why are you using regexes instead of strip_tags()?
>
> --
> Matthew Weier O'Phinney | WEBSITES:
> Webmaster and IT Specialist | http://www.garden.org
> National Gardening Association | http://www.kidsgardening.com
> 802-863-5251 x156 | http://nationalgardenmonth.org
> mailto:matthew@garden.org | http://vermontbotanical.org
>

I don't want to strip out all the tags, just certain ones. But the
problem turned out not to be in this peice of code- the script simply
wasn't parsing. I started another thread with that problem after
failing to fix it on my own.

Dotan
http://lyricslist.com/lyrics/pages/artist_albums.php/19/Adams%2C%20Bryan
Bryan Adams Lyrics

 

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

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