Reply to Re: tricky replace function

Your name:

Reply:


Posted by Michael Fesser on 11/04/07 10:44

..oO(windandwaves)

>I need to write a tricky replacement function.
>
>C = replace A with B in C
>C = replace D with E in C
>
>examples of A could be "a cat climbs a tree", examples of B could be
>"a dog climbs a alligator". Thereby, I want to make sure that parts
>that have already been replaced will not be replaced again (by the E
>replaces D statement for example). I will mark all new text (Bs and
>Es) with <span class="replacePart">... new text here ....</span>.
>
>How could I go about this? Could I use a regular expression?

You could try strtr() first, called with only two parameters. See the
manual for details.

http://www.php.net/strtr

Micha

[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

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