I have the following string
$strString = "balbalbalbalbalbablablafoobalbalbalbalbalabfooblablbalbalbalba<a href='dogfood.php'>food for dogs</a>blablablbalablablabla";
$strSearch = "foo";
$strReplace = "<font color='#FF0000>foo</font>";
I want to replace the word foo (wich is my search-string) with <font color='#FF0000>foo</font>,
except when i use eregi_replace($strSearch,$strReplace,$strString) it
replaces the stuff which is in between the tags as well.
So the output is :
balbalbalbalbalbablabla<font color='#FF0000>foo</font>balbalbalbalbalab<font color='#FF0000>foo</font>blablbalbalbalba<a href='dog<font color='#FF0000>foo</font>d.php'><font color='#FF0000>foo</font>d for dogs</a>blablablbalablablabla
As you can see, the link (dogfood.php) is replaced with $strRepl !!!
How do I solve this problem ??
Thanks for helping me out !