You are here: replace all occurrences of a substring in a string (RE) « All PHP « IT news, forums, messages
replace all occurrences of a substring in a string (RE)

Posted by Piratron on 02/13/06 01:05

Hey ppl,

I have a problem which needs to be solved very soon :)
Anyway I would like to replace all occurrences of a substring in a
string which consists of html code.
However those substrings appear between few ignore tags as in example
bellow.

Code (string variable):
-----------------------
<!--c1--><div class='codetop'>CODE</div><div
class='codemain'><!--ec1-->{POST_CODE}<!--ec2-->
-----------------------

so, I would like to replace all occurrences of "{POST_CODE}" with
another string. To be precise {POST_CODE} is actually html data of
variable length.

After all I would like to use preg_replace or eregi_replace. What do you
think? Or it can be solved by using another methods?

Thank you very much,

Piratron


--
Please visit our site at:
www.symbian-mobile.org

Regards,
Symbian-Mobile Team

 

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

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