I need to go through a string and replace "a" with "b", and I tried using string_replace, however, here is my problem:
Say I want to replace "the" with "stuff".
This works for "the", but it also works for "other", etc.
So if i try to replace "the" with "stuff" and "other" apperas in the string, it replaces it as "ostuffr".
I need to be able to replace ONLY the in a string, and no other matches. How do I do this without replacing other occurances?
If it matters the string also containts html and javascript code... basically I'm writing a translation engine to translate websites... the code works, but the easiester part (replacing) is the only thing I can't get.
Thanks in advance, sorry about the long message!