You are here: strip tags with contents n times « PHP Programming Language « IT news, forums, messages
strip tags with contents n times

Posted by Peter Parker on 05/22/07 06:16

What is the best way to delete tags n times from either the beginning or the
end of a String? For example, to delete "someString1" and "someString2"
along with surrounding <someTag>'s with n=2 and processing direction is from
beginning.

$someBigString="<someTag>someString1</someTag><someTag>someString2</someTag><someTag>someString3</someTag>";

I was thinking about use preg_replace() to replace "/</tag><tag/" with ""
but wasn't sure how, especially about the n times and direction of
processing. Any suggestion? Is using prreg_replace() the best way to
accomplish this task? Thanks.

 

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

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